fix(tools): keep web_search top-level under xdev
web_search is a discoverable built-in, so with tools.xdev defaulting to true createTools mounted it under xd:// and dropped it from the top-level toolset. Models that call web_search directly got "Tool web_search not found" on default configs. Pin it in XDEV_KEEP_TOP_LEVEL so it stays a direct-callable tool while other discoverable tools keep mounting. Fixes #5973
This commit is contained in:
@@ -206,3 +206,22 @@ describe("read and write route xd:// device URLs", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("web_search stays top-level under xdev", () => {
|
||||
it("keeps web_search a direct tool and off the xd:// registry with default config", async () => {
|
||||
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "write-xdev-websearch-"));
|
||||
try {
|
||||
const session = xdevSession(tempDir);
|
||||
// Default config: tools.xdev is on.
|
||||
expect(session.settings.get("tools.xdev")).toBe(true);
|
||||
const tools = await createTools(session);
|
||||
// Regression for #5973: models call web_search directly, so it must
|
||||
// remain a top-level function and never mount behind the xd:// device.
|
||||
expect(tools.some(entry => entry.name === "web_search")).toBe(true);
|
||||
const mounted = session.xdevRegistry ? [...session.xdevRegistry.list()].map(t => t.name) : [];
|
||||
expect(mounted).not.toContain("web_search");
|
||||
} finally {
|
||||
await removeWithRetries(tempDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user