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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Engineering at Meta
Engineering at Meta
量子位
A
About on SuperTechFans
阮一峰的网络日志
阮一峰的网络日志
Recent Announcements
Recent Announcements
博客园 - 司徒正美
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
腾讯CDC
Jina AI
Jina AI
C
Check Point Blog
H
Help Net Security
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
爱范儿
爱范儿
I
InfoQ

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
test: tighten web search provider runtime assertions · op...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -207,13 +207,32 @@ function expectLoaderCallCount(count: number) {

207207

expect(loadOpenClawPluginsMock).toHaveBeenCalledTimes(count);

208208

}

209209210+

function requireRecord(value: unknown): Record<string, unknown> {

211+

expect(value).toBeTruthy();

212+

expect(typeof value).toBe("object");

213+

expect(Array.isArray(value)).toBe(false);

214+

return value as Record<string, unknown>;

215+

}

216+217+

function requireLastCallFirstArg(

218+

mock: { mock: { calls: readonly (readonly unknown[])[] } },

219+

label: string,

220+

): Record<string, unknown> {

221+

const call = mock.mock.calls.at(-1);

222+

expect(call, `${label} should have been called`).toBeTruthy();

223+

return requireRecord(call?.[0]);

224+

}

225+226+

function requirePluginsConfig(params: Record<string, unknown>): Record<string, unknown> {

227+

const config = requireRecord(params.config);

228+

return requireRecord(config.plugins);

229+

}

230+210231

function expectScopedWebSearchCandidates(pluginIds: readonly string[]) {

211232

expect(loadInstalledPluginManifestRegistryMock).toHaveBeenCalled();

212-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

213-

expect.objectContaining({

214-

onlyPluginIds: [...pluginIds],

215-

}),

216-

);

233+

expect(

234+

requireLastCallFirstArg(loadOpenClawPluginsMock, "loadOpenClawPlugins").onlyPluginIds,

235+

).toEqual([...pluginIds]);

217236

}

218237219238

function expectAutoEnabledWebSearchLoad(params: {

@@ -224,15 +243,9 @@ function expectAutoEnabledWebSearchLoad(params: {

224243

config: params.rawConfig,

225244

env: createWebSearchEnv(),

226245

});

227-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

228-

expect.objectContaining({

229-

config: expect.objectContaining({

230-

plugins: expect.objectContaining({

231-

allow: expect.arrayContaining([...params.expectedAllow]),

232-

}),

233-

}),

234-

}),

235-

);

246+

const loaderParams = requireLastCallFirstArg(loadOpenClawPluginsMock, "loadOpenClawPlugins");

247+

const plugins = requirePluginsConfig(loaderParams);

248+

expect(plugins.allow).toEqual([...params.expectedAllow]);

236249

}

237250238251

function expectSnapshotLoaderCalls(params: {

@@ -505,17 +518,12 @@ describe("resolvePluginWebSearchProviders", () => {

505518506519

expect(toRuntimeProviderKeys(providers)).toEqual(["brave:brave"]);

507520

expectScopedWebSearchCandidates(["brave"]);

508-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

509-

expect.objectContaining({

510-

config: expect.objectContaining({

511-

plugins: expect.objectContaining({

512-

allow: ["brave"],

513-

bundledDiscovery: "allowlist",

514-

entries: { brave: { enabled: true } },

515-

}),

516-

}),

517-

}),

518-

);

521+

const loaderParams = requireLastCallFirstArg(loadOpenClawPluginsMock, "loadOpenClawPlugins");

522+

expect(requirePluginsConfig(loaderParams)).toEqual({

523+

allow: ["brave"],

524+

bundledDiscovery: "allowlist",

525+

entries: { brave: { enabled: true } },

526+

});

519527

});

520528521529

it("uses the active registry workspace for candidate discovery and snapshot loads when workspaceDir is omitted", () => {

@@ -535,17 +543,14 @@ describe("resolvePluginWebSearchProviders", () => {

535543

env,

536544

});

537545538-

expect(loadInstalledPluginManifestRegistryMock).toHaveBeenCalledWith(

539-

expect.objectContaining({

540-

workspaceDir: "/tmp/runtime-workspace",

541-

}),

542-

);

543-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

544-

expect.objectContaining({

545-

workspaceDir: "/tmp/runtime-workspace",

546-

onlyPluginIds: ["brave"],

547-

}),

546+

const manifestParams = requireLastCallFirstArg(

547+

loadInstalledPluginManifestRegistryMock,

548+

"loadPluginManifestRegistryForInstalledIndex",

548549

);

550+

expect(manifestParams.workspaceDir).toBe("/tmp/runtime-workspace");

551+

const loaderParams = requireLastCallFirstArg(loadOpenClawPluginsMock, "loadOpenClawPlugins");

552+

expect(loaderParams.workspaceDir).toBe("/tmp/runtime-workspace");

553+

expect(loaderParams.onlyPluginIds).toEqual(["brave"]);

549554

});

550555

it("reuses a compatible active registry for snapshot resolution when config is provided", () => {

551556

const { env, rawConfig } = createActiveBraveRegistryFixture();