fix: enable web search by default

This commit is contained in:
Josh Lambert
2026-07-27 11:48:09 -04:00
parent 91d87588bf
commit 34e787e5ac
6 changed files with 40 additions and 25 deletions
@@ -152,10 +152,10 @@ describe("global config updates", () => {
})
describe("kilocode web search config", () => {
test("accepts the websearch availability setting", () => {
const config = Schema.decodeUnknownSync(Config.Info)({ web_search: true })
test("accepts explicitly limiting web search to managed providers", () => {
const config = Schema.decodeUnknownSync(Config.Info)({ web_search: false })
expect(config.web_search).toBe(true)
expect(config.web_search).toBe(false)
})
})
+32 -18
View File
@@ -125,7 +125,21 @@ const websearch = testEffect(
config: {
get: () =>
Effect.succeed({
web_search: true,
provider: { openai: { options: { apiKey: "test-openai-key" } } },
}),
},
}),
node,
Agent.defaultLayer,
),
)
const websearchOff = testEffect(
Layer.mergeAll(
registryLayer({
config: {
get: () =>
Effect.succeed({
web_search: false,
provider: { openai: { options: { apiKey: "test-openai-key" } } },
}),
},
@@ -155,23 +169,7 @@ function sandboxProfile(): Profile {
describe("tool.registry", () => {
// kilocode_change start
it.instance("hides websearch for a third-party provider by default", () =>
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)).not.toContain("websearch")
}),
)
websearch.instance("shows websearch for a configured third-party provider when enabled", () =>
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
@@ -187,6 +185,22 @@ describe("tool.registry", () => {
}),
)
websearchOff.instance("hides websearch for a configured third-party provider when disabled", () =>
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)).not.toContain("websearch")
}),
)
sandboxed.instance("preserves built-in network classification through production tool definition processing", () =>
Effect.gen(function* () {
const registry = yield* ToolRegistry.Service