fix: keep third-party web search opt-in

This commit is contained in:
Josh Lambert
2026-07-27 14:47:11 -04:00
parent 34e787e5ac
commit c5d3032118
7 changed files with 26 additions and 41 deletions
@@ -152,10 +152,10 @@ describe("global config updates", () => {
})
describe("kilocode web search config", () => {
test("accepts explicitly limiting web search to managed providers", () => {
const config = Schema.decodeUnknownSync(Config.Info)({ web_search: false })
test("accepts enabling web search for all providers", () => {
const config = Schema.decodeUnknownSync(Config.Info)({ web_search: true })
expect(config.web_search).toBe(false)
expect(config.web_search).toBe(true)
})
})
+18 -32
View File
@@ -125,21 +125,7 @@ const websearch = testEffect(
config: {
get: () =>
Effect.succeed({
provider: { openai: { options: { apiKey: "test-openai-key" } } },
}),
},
}),
node,
Agent.defaultLayer,
),
)
const websearchOff = testEffect(
Layer.mergeAll(
registryLayer({
config: {
get: () =>
Effect.succeed({
web_search: false,
web_search: true,
provider: { openai: { options: { apiKey: "test-openai-key" } } },
}),
},
@@ -169,23 +155,7 @@ function sandboxProfile(): Profile {
describe("tool.registry", () => {
// kilocode_change start
websearch.instance("shows websearch by default for a configured third-party provider", () =>
Effect.gen(function* () {
const registry = yield* ToolRegistry.Service
const agent = yield* Agent.Service
const build = yield* agent.get("build")
if (!build) return yield* Effect.die(new Error("build agent not found"))
const tools = yield* registry.tools({
providerID: ProviderV2.ID.openai,
modelID: ModelV2.ID.make("test"),
agent: build,
})
expect(tools.map((tool) => tool.id)).toContain("websearch")
}),
)
websearchOff.instance("hides websearch for a configured third-party provider when disabled", () =>
it.instance("hides websearch for a third-party provider by default", () =>
Effect.gen(function* () {
const registry = yield* ToolRegistry.Service
const agent = yield* Agent.Service
@@ -201,6 +171,22 @@ describe("tool.registry", () => {
}),
)
websearch.instance("shows websearch for a configured third-party provider when enabled", () =>
Effect.gen(function* () {
const registry = yield* ToolRegistry.Service
const agent = yield* Agent.Service
const build = yield* agent.get("build")
if (!build) return yield* Effect.die(new Error("build agent not found"))
const tools = yield* registry.tools({
providerID: ProviderV2.ID.openai,
modelID: ModelV2.ID.make("test"),
agent: build,
})
expect(tools.map((tool) => tool.id)).toContain("websearch")
}),
)
sandboxed.instance("preserves built-in network classification through production tool definition processing", () =>
Effect.gen(function* () {
const registry = yield* ToolRegistry.Service