feat: add routed online search providers

This commit is contained in:
云服务部-叶林立
2026-08-19 11:04:03 +08:00
parent bf8bb42a09
commit 5a85660b5d
12 changed files with 500 additions and 5 deletions
+19
View File
@@ -44,6 +44,23 @@ test("LSP routing covers navigation and post-edit diagnostics", () => {
assert.match(section, /post-edit diagnostics/);
});
test("online search routing selects providers by task", () => {
const tavily = buildToolRoutingSection(["tavily_web_search", "tavily_web_fetch"]);
assert.match(tavily, /broad discovery when keywords are uncertain/);
assert.match(tavily, /news\/recent\/trending topics/);
assert.doesNotMatch(tavily, /official or API documentation/);
const exa = buildToolRoutingSection(["exa_web_search", "exa_web_fetch", "exa_web_search_advanced"]);
assert.match(exa, /official or API documentation/);
assert.match(exa, /explicitly bound the result count and returned text length/);
assert.doesNotMatch(exa, /Chinese-language pages/);
const keenable = buildToolRoutingSection(["keenable_search", "keenable_fetch"]);
assert.match(keenable, /Chinese-language pages, policies and government notices/);
assert.match(keenable, /site-restricted search/);
assert.match(keenable, /publication-date filtering/);
});
test("routing includes only guidance for active optional tools", () => {
const section = buildToolRoutingSection(["read"]);
@@ -52,6 +69,8 @@ test("routing includes only guidance for active optional tools", () => {
assert.doesNotMatch(section, /Use Context Mode/);
assert.doesNotMatch(section, /ctx_execute_file is confined/);
assert.doesNotMatch(section, /fresh LINE#HASH anchors/);
assert.doesNotMatch(section, /Choose one online search provider/);
assert.doesNotMatch(section, /broad discovery when keywords are uncertain/);
assert.match(section, /Use read only when exact source is needed/);
});