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

推荐订阅源

云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
爱范儿
爱范儿
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
博客园_首页
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园 - Franky
量子位
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

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

@@ -27,6 +27,56 @@ function withActivatedPluginIdsForTest<T extends Record<string, unknown>>(

2727

};

2828

}

292930+

function expectConfiguredChannelPluginIdsParams(expected: {

31+

config: unknown;

32+

workspaceDir?: string;

33+

}) {

34+

expect(mocks.resolveConfiguredChannelPluginIds).toHaveBeenCalledTimes(1);

35+

const params = mocks.resolveConfiguredChannelPluginIds.mock.calls[0]?.[0] as

36+

| { config?: unknown; env?: NodeJS.ProcessEnv; workspaceDir?: string }

37+

| undefined;

38+

expect(params?.config).toBe(expected.config);

39+

expect(params?.env).toBe(process.env);

40+

expect(params?.workspaceDir).toBe(expected.workspaceDir);

41+

}

42+43+

function expectLoadOpenClawPluginsCall(

44+

callIndex: number,

45+

expected: {

46+

config?: unknown;

47+

activationSourceConfig?: unknown;

48+

autoEnabledReasons?: unknown;

49+

onlyPluginIds: string[];

50+

throwOnLoadError: boolean;

51+

workspaceDir?: string;

52+

},

53+

) {

54+

const params = mocks.loadOpenClawPlugins.mock.calls[callIndex]?.[0] as

55+

| {

56+

config?: unknown;

57+

activationSourceConfig?: unknown;

58+

autoEnabledReasons?: unknown;

59+

onlyPluginIds?: string[];

60+

throwOnLoadError?: boolean;

61+

workspaceDir?: string;

62+

}

63+

| undefined;

64+

if ("config" in expected) {

65+

expect(params?.config).toEqual(expected.config);

66+

}

67+

if ("activationSourceConfig" in expected) {

68+

expect(params?.activationSourceConfig).toEqual(expected.activationSourceConfig);

69+

}

70+

if ("autoEnabledReasons" in expected) {

71+

expect(params?.autoEnabledReasons).toEqual(expected.autoEnabledReasons);

72+

}

73+

expect(params?.onlyPluginIds).toEqual(expected.onlyPluginIds);

74+

expect(params?.throwOnLoadError).toBe(expected.throwOnLoadError);

75+

if ("workspaceDir" in expected) {

76+

expect(params?.workspaceDir).toBe(expected.workspaceDir);

77+

}

78+

}

79+3080

const mocks = vi.hoisted(() => ({

3181

loadOpenClawPlugins: vi.fn<typeof import("../plugins/loader.js").loadOpenClawPlugins>(),

3282

resolveCompatibleRuntimePluginRegistry:

@@ -193,25 +243,21 @@ describe("ensurePluginRegistryLoaded", () => {

193243194244

ensurePluginRegistryLoaded({ scope: "configured-channels" });

195245196-

expect(mocks.resolveConfiguredChannelPluginIds).toHaveBeenCalledWith(

197-

expect.objectContaining({

198-

config: autoEnabledConfig,

199-

env: process.env,

200-

workspaceDir: "/tmp/workspace",

201-

}),

202-

);

203-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

204-

expect.objectContaining({

205-

config: autoEnabledConfig,

206-

activationSourceConfig: autoEnabledConfig,

207-

autoEnabledReasons: {

208-

"demo-chat": ["demo-chat configured"],

209-

},

210-

onlyPluginIds: ["demo-chat"],

211-

throwOnLoadError: true,

212-

workspaceDir: "/tmp/workspace",

213-

}),

214-

);

246+

expectConfiguredChannelPluginIdsParams({

247+

config: autoEnabledConfig,

248+

workspaceDir: "/tmp/workspace",

249+

});

250+

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(1);

251+

expectLoadOpenClawPluginsCall(0, {

252+

config: autoEnabledConfig,

253+

activationSourceConfig: autoEnabledConfig,

254+

autoEnabledReasons: {

255+

"demo-chat": ["demo-chat configured"],

256+

},

257+

onlyPluginIds: ["demo-chat"],

258+

throwOnLoadError: true,

259+

workspaceDir: "/tmp/workspace",

260+

});

215261

});

216262217263

it("reloads when escalating from configured-channels to channels", () => {

@@ -236,20 +282,14 @@ describe("ensurePluginRegistryLoaded", () => {

236282

ensurePluginRegistryLoaded({ scope: "channels" });

237283238284

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(2);

239-

expect(mocks.loadOpenClawPlugins).toHaveBeenNthCalledWith(

240-

1,

241-

expect.objectContaining({

242-

onlyPluginIds: ["demo-channel-a"],

243-

throwOnLoadError: true,

244-

}),

245-

);

246-

expect(mocks.loadOpenClawPlugins).toHaveBeenNthCalledWith(

247-

2,

248-

expect.objectContaining({

249-

onlyPluginIds: ["demo-channel-a", "demo-channel-b"],

250-

throwOnLoadError: true,

251-

}),

252-

);

285+

expectLoadOpenClawPluginsCall(0, {

286+

onlyPluginIds: ["demo-channel-a"],

287+

throwOnLoadError: true,

288+

});

289+

expectLoadOpenClawPluginsCall(1, {

290+

onlyPluginIds: ["demo-channel-a", "demo-channel-b"],

291+

throwOnLoadError: true,

292+

});

253293

});

254294255295

it("does not treat a pre-seeded partial registry as all scope", () => {

@@ -276,14 +316,12 @@ describe("ensurePluginRegistryLoaded", () => {

276316

ensurePluginRegistryLoaded({ scope: "all" });

277317278318

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(1);

279-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

280-

expect.objectContaining({

281-

config,

282-

onlyPluginIds: ["demo"],

283-

throwOnLoadError: true,

284-

workspaceDir: "/tmp/workspace",

285-

}),

286-

);

319+

expectLoadOpenClawPluginsCall(0, {

320+

config,

321+

onlyPluginIds: ["demo"],

322+

throwOnLoadError: true,

323+

workspaceDir: "/tmp/workspace",

324+

});

287325

});

288326289327

it("does not treat a tools-only pre-seeded registry as channel scope", () => {

@@ -312,15 +350,13 @@ describe("ensurePluginRegistryLoaded", () => {

312350

ensurePluginRegistryLoaded({ scope: "configured-channels" });

313351314352

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(1);

315-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

316-

expect.objectContaining({

317-

config: activatedConfig,

318-

activationSourceConfig: activatedConfig,

319-

onlyPluginIds: ["demo-channel-a"],

320-

throwOnLoadError: true,

321-

workspaceDir: "/tmp/workspace",

322-

}),

323-

);

353+

expectLoadOpenClawPluginsCall(0, {

354+

config: activatedConfig,

355+

activationSourceConfig: activatedConfig,

356+

onlyPluginIds: ["demo-channel-a"],

357+

throwOnLoadError: true,

358+

workspaceDir: "/tmp/workspace",

359+

});

324360

});

325361326362

it("reloads when a pre-seeded channel registry is missing the configured channel plugin ids", () => {

@@ -353,14 +389,12 @@ describe("ensurePluginRegistryLoaded", () => {

353389

ensurePluginRegistryLoaded({ scope: "configured-channels" });

354390355391

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(1);

356-

expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(

357-

expect.objectContaining({

358-

config: activatedConfig,

359-

activationSourceConfig: activatedConfig,

360-

onlyPluginIds: ["demo-channel-a"],

361-

throwOnLoadError: true,

362-

workspaceDir: "/tmp/workspace",

363-

}),

364-

);

392+

expectLoadOpenClawPluginsCall(0, {

393+

config: activatedConfig,

394+

activationSourceConfig: activatedConfig,

395+

onlyPluginIds: ["demo-channel-a"],

396+

throwOnLoadError: true,

397+

workspaceDir: "/tmp/workspace",

398+

});

365399

});

366400

});