惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - Franky
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
月光博客
月光博客
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
Last Week in AI
Last Week in AI
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
J
Java Code Geeks
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(web_search): skip redundant provider re-resolution fo...
openperf · 2026-05-06 · via Recent Commits to openclaw:main

@@ -1564,4 +1564,94 @@ describe("runtime web tools resolution", () => {

15641564

expect(resolveBundledWebFetchProvidersFromPublicArtifactsMock).not.toHaveBeenCalled();

15651565

expect(resolvePluginWebFetchProvidersMock).not.toHaveBeenCalled();

15661566

});

1567+1568+

describe("when brave is installed as an external plugin and explicitly configured", () => {

1569+

const externalBraveImpl = ({

1570+

value,

1571+

origin,

1572+

}: {

1573+

value: string;

1574+

origin?: string;

1575+

}): string | undefined => {

1576+

if (origin === "bundled" && value === "brave") {

1577+

return undefined;

1578+

}

1579+

return (

1580+

{

1581+

brave: "brave",

1582+

firecrawl: "firecrawl",

1583+

gemini: "google",

1584+

grok: "xai",

1585+

kimi: "moonshot",

1586+

perplexity: "perplexity",

1587+

} as Record<string, string | undefined>

1588+

)[value];

1589+

};

1590+1591+

const defaultImpl = ({ value }: { value: string }): string | undefined =>

1592+

(

1593+

({

1594+

brave: "brave",

1595+

firecrawl: "firecrawl",

1596+

gemini: "google",

1597+

grok: "xai",

1598+

kimi: "moonshot",

1599+

perplexity: "perplexity",

1600+

}) as Record<string, string | undefined>

1601+

)[value];

1602+1603+

beforeEach(() => {

1604+

loadInstalledPluginIndexInstallRecordsSyncMock.mockReturnValue({

1605+

brave: { source: "npm", spec: "@openclaw/brave-search" },

1606+

});

1607+

resolveManifestContractOwnerPluginIdMock.mockImplementation(externalBraveImpl);

1608+

});

1609+1610+

afterEach(() => {

1611+

resolveManifestContractOwnerPluginIdMock.mockImplementation(defaultImpl);

1612+

});

1613+1614+

it("selects the configured provider without re-invoking provider discovery when found in the first pass", async () => {

1615+

resolvePluginWebSearchProvidersMock

1616+

.mockReturnValueOnce(buildTestWebSearchProviders())

1617+

.mockReturnValueOnce([]);

1618+1619+

const { metadata, context } = await runRuntimeWebTools({

1620+

config: asConfig({

1621+

tools: {

1622+

web: {

1623+

search: {

1624+

provider: "brave",

1625+

},

1626+

},

1627+

},

1628+

plugins: {

1629+

entries: {

1630+

brave: {

1631+

config: {

1632+

webSearch: {

1633+

apiKey: "brave-api-key", // pragma: allowlist secret

1634+

},

1635+

},

1636+

},

1637+

},

1638+

},

1639+

}),

1640+

});

1641+1642+

expect(metadata.search.selectedProvider).toBe("brave");

1643+

expect(metadata.search.providerSource).toBe("configured");

1644+

expect(metadata.search.selectedProviderKeySource).toBe("config");

1645+

expect(context.warnings).not.toEqual(

1646+

expect.arrayContaining([

1647+

expect.objectContaining({ code: "WEB_SEARCH_PROVIDER_INVALID_AUTODETECT" }),

1648+

]),

1649+

);

1650+

expect(resolvePluginWebSearchProvidersMock).toHaveBeenCalledTimes(1);

1651+

expect(

1652+

resolveBundledExplicitWebSearchProvidersFromPublicArtifactsMock,

1653+

).not.toHaveBeenCalled();

1654+

expect(resolveBundledWebSearchProvidersFromPublicArtifactsMock).not.toHaveBeenCalled();

1655+

});

1656+

});

15671657

});