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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
量子位
S
SegmentFault 最新的问题
博客园 - 聂微东
博客园 - 【当耐特】
J
Java Code Geeks
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
V
V2EX
人人都是产品经理
人人都是产品经理
博客园 - Franky
罗磊的独立博客
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research

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

@@ -47,6 +47,17 @@ vi.mock("./runtime/load-context.js", () => ({

4747

let resolvePluginWebProviders: typeof import("./web-provider-runtime-shared.js").resolvePluginWebProviders;

4848

let resolveRuntimeWebProviders: typeof import("./web-provider-runtime-shared.js").resolveRuntimeWebProviders;

494950+

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

51+

expect(value).toBeTruthy();

52+

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

53+

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

54+

return value as Record<string, unknown>;

55+

}

56+57+

function mockArg(mock: ReturnType<typeof vi.fn>, callIndex = 0): Record<string, unknown> {

58+

return requireRecord(mock.mock.calls[callIndex]?.[0]);

59+

}

60+5061

describe("web-provider-runtime-shared", () => {

5162

beforeAll(async () => {

5263

({ resolvePluginWebProviders, resolveRuntimeWebProviders } =

@@ -97,16 +108,8 @@ describe("web-provider-runtime-shared", () => {

97108

},

98109

);

99110100-

expect(mocks.getLoadedRuntimePluginRegistry).toHaveBeenCalledWith(

101-

expect.objectContaining({

102-

requiredPluginIds: [],

103-

}),

104-

);

105-

expect(mapRegistryProviders).toHaveBeenCalledWith(

106-

expect.objectContaining({

107-

onlyPluginIds: [],

108-

}),

109-

);

111+

expect(mockArg(mocks.getLoadedRuntimePluginRegistry).requiredPluginIds).toEqual([]);

112+

expect(mockArg(mapRegistryProviders).onlyPluginIds).toEqual([]);

110113

});

111114112115

it("preserves explicit empty scopes in direct runtime web provider resolution", () => {

@@ -129,16 +132,8 @@ describe("web-provider-runtime-shared", () => {

129132

},

130133

);

131134132-

expect(mocks.getLoadedRuntimePluginRegistry).toHaveBeenCalledWith(

133-

expect.objectContaining({

134-

requiredPluginIds: [],

135-

}),

136-

);

137-

expect(mapRegistryProviders).toHaveBeenCalledWith(

138-

expect.objectContaining({

139-

onlyPluginIds: [],

140-

}),

141-

);

135+

expect(mockArg(mocks.getLoadedRuntimePluginRegistry).requiredPluginIds).toEqual([]);

136+

expect(mockArg(mapRegistryProviders).onlyPluginIds).toEqual([]);

142137

});

143138144139

it("preserves explicit scopes when config is omitted in direct runtime resolution", () => {

@@ -160,16 +155,8 @@ describe("web-provider-runtime-shared", () => {

160155

},

161156

);

162157163-

expect(mocks.getLoadedRuntimePluginRegistry).toHaveBeenCalledWith(

164-

expect.objectContaining({

165-

requiredPluginIds: ["alpha"],

166-

}),

167-

);

168-

expect(mapRegistryProviders).toHaveBeenCalledWith(

169-

expect.objectContaining({

170-

onlyPluginIds: ["alpha"],

171-

}),

172-

);

158+

expect(mockArg(mocks.getLoadedRuntimePluginRegistry).requiredPluginIds).toEqual(["alpha"]);

159+

expect(mockArg(mapRegistryProviders).onlyPluginIds).toEqual(["alpha"]);

173160

});

174161175162

it("reuses the active registry after deriving web provider candidates from resolved config", () => {

@@ -263,11 +250,7 @@ describe("web-provider-runtime-shared", () => {

263250

);

264251265252

expect(providers).toEqual(["provider"]);

266-

expect(mocks.getLoadedRuntimePluginRegistry).toHaveBeenCalledWith(

267-

expect.objectContaining({

268-

requiredPluginIds: ["brave"],

269-

}),

270-

);

253+

expect(mockArg(mocks.getLoadedRuntimePluginRegistry).requiredPluginIds).toEqual(["brave"]);

271254

expect(mocks.loadOpenClawPlugins).not.toHaveBeenCalled();

272255

});

273256

@@ -293,11 +276,7 @@ describe("web-provider-runtime-shared", () => {

293276

},

294277

);

295278296-

expect(mocks.getLoadedRuntimePluginRegistry).toHaveBeenCalledWith(

297-

expect.objectContaining({

298-

requiredPluginIds: ["brave"],

299-

}),

300-

);

279+

expect(mockArg(mocks.getLoadedRuntimePluginRegistry).requiredPluginIds).toEqual(["brave"]);

301280

expect(mocks.loadOpenClawPlugins).not.toHaveBeenCalled();

302281

});

303282

@@ -324,12 +303,8 @@ describe("web-provider-runtime-shared", () => {

324303

);

325304326305

expect(providers).toEqual(["provider"]);

327-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

328-

expect.objectContaining({

329-

cache: true,

330-

onlyPluginIds: ["brave"],

331-

}),

332-

);

306+

expect(mockArg(mocks.loadOpenClawPlugins).cache).toBe(true);

307+

expect(mockArg(mocks.loadOpenClawPlugins).onlyPluginIds).toEqual(["brave"]);

333308

});

334309335310

it("falls back to a scoped provider load when the active runtime registry has no web providers", () => {

@@ -469,11 +444,7 @@ describe("web-provider-runtime-shared", () => {

469444

},

470445

);

471446472-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

473-

expect.objectContaining({

474-

cache: false,

475-

onlyPluginIds: ["brave"],

476-

}),

477-

);

447+

expect(mockArg(mocks.loadOpenClawPlugins).cache).toBe(false);

448+

expect(mockArg(mocks.loadOpenClawPlugins).onlyPluginIds).toEqual(["brave"]);

478449

});

479450

});