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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog

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: reuse manifest pass for runtime contract owners · op...
shakkernerd · 2026-04-27 · via Recent Commits to openclaw:main

@@ -8,17 +8,32 @@ type MockManifestRegistry = {

88

diagnostics: unknown[];

99

};

101011+

type MockPluginIndex = {

12+

plugins: Array<{

13+

pluginId: string;

14+

origin: string;

15+

enabled: boolean;

16+

enabledByDefault?: boolean;

17+

}>;

18+

diagnostics: unknown[];

19+

};

20+1121

function createEmptyMockManifestRegistry(): MockManifestRegistry {

1222

return { plugins: [], diagnostics: [] };

1323

}

142425+

function createMockPluginIndex(plugins: MockPluginIndex["plugins"]): MockPluginIndex {

26+

return { plugins, diagnostics: [] };

27+

}

28+1529

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

1630

resolveRuntimePluginRegistry: vi.fn<(params?: unknown) => PluginRegistry | undefined>(

1731

() => undefined,

1832

),

1933

loadPluginManifestRegistry: vi.fn<(params?: Record<string, unknown>) => MockManifestRegistry>(

2034

() => createEmptyMockManifestRegistry(),

2135

),

36+

loadPluginRegistrySnapshot: vi.fn<() => MockPluginIndex>(() => createMockPluginIndex([])),

2237

withBundledPluginAllowlistCompat: vi.fn(

2338

({ config }: { config?: OpenClawConfig; pluginIds: string[] }) => config,

2439

),

@@ -35,7 +50,11 @@ vi.mock("./loader.js", () => ({

3550

}));

36513752

vi.mock("./plugin-registry.js", () => ({

38-

loadPluginManifestRegistryForPluginRegistry: mocks.loadPluginManifestRegistry,

53+

loadPluginRegistrySnapshot: mocks.loadPluginRegistrySnapshot,

54+

}));

55+56+

vi.mock("./manifest-registry-installed.js", () => ({

57+

loadPluginManifestRegistryForInstalledIndex: mocks.loadPluginManifestRegistry,

3958

}));

40594160

vi.mock("./bundled-compat.js", () => ({

@@ -61,6 +80,7 @@ describe("migration provider runtime", () => {

6180

vi.clearAllMocks();

6281

mocks.resolveRuntimePluginRegistry.mockReturnValue(createEmptyPluginRegistry());

6382

mocks.loadPluginManifestRegistry.mockReturnValue(createEmptyMockManifestRegistry());

83+

mocks.loadPluginRegistrySnapshot.mockReturnValue(createMockPluginIndex([]));

6484

const runtime = await import("./migration-provider-runtime.js");

6585

resolvePluginMigrationProvider = runtime.resolvePluginMigrationProvider;

6686

resolvePluginMigrationProviders = runtime.resolvePluginMigrationProviders;

@@ -82,6 +102,20 @@ describe("migration provider runtime", () => {

82102

mocks.resolveRuntimePluginRegistry.mockImplementation((params?: unknown) =>

83103

params === undefined ? active : loaded,

84104

);

105+

mocks.loadPluginRegistrySnapshot.mockReturnValue(

106+

createMockPluginIndex([

107+

{

108+

pluginId: "external-migration",

109+

origin: "installed",

110+

enabled: true,

111+

},

112+

{

113+

pluginId: "disabled-external-migration",

114+

origin: "installed",

115+

enabled: false,

116+

},

117+

]),

118+

);

85119

mocks.loadPluginManifestRegistry.mockImplementation((params?: Record<string, unknown>) => ({

86120

diagnostics: [],

87121

plugins: params?.includeDisabled

@@ -109,11 +143,20 @@ describe("migration provider runtime", () => {

109143

const resolved = resolvePluginMigrationProvider({ providerId: "external-import", cfg });

110144111145

expect(resolved).toBe(provider);

146+

expect(mocks.loadPluginRegistrySnapshot).toHaveBeenCalledWith({

147+

config: cfg,

148+

env: process.env,

149+

preferPersisted: false,

150+

});

112151

expect(mocks.loadPluginManifestRegistry).toHaveBeenCalledWith({

152+

index: expect.objectContaining({

153+

plugins: expect.arrayContaining([

154+

expect.objectContaining({ pluginId: "external-migration" }),

155+

]),

156+

}),

113157

config: cfg,

114158

env: process.env,

115159

includeDisabled: true,

116-

preferPersisted: false,

117160

});

118161

expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith();

119162

expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({

@@ -136,30 +179,41 @@ describe("migration provider runtime", () => {

136179

mocks.resolveRuntimePluginRegistry.mockImplementation((params?: unknown) =>

137180

params === undefined ? active : loaded,

138181

);

139-

mocks.loadPluginManifestRegistry.mockImplementation((params?: Record<string, unknown>) => {

140-

if (params?.preferPersisted !== false) {

141-

return createEmptyMockManifestRegistry();

142-

}

143-

return {

144-

diagnostics: [],

145-

plugins: [

146-

{

147-

id: "migrate-hermes",

148-

origin: "bundled",

149-

contracts: { migrationProviders: ["hermes"] },

150-

},

151-

],

152-

};

153-

});

182+

mocks.loadPluginRegistrySnapshot.mockReturnValue(

183+

createMockPluginIndex([

184+

{

185+

pluginId: "migrate-hermes",

186+

origin: "bundled",

187+

enabled: true,

188+

},

189+

]),

190+

);

191+

mocks.loadPluginManifestRegistry.mockImplementation(() => ({

192+

diagnostics: [],

193+

plugins: [

194+

{

195+

id: "migrate-hermes",

196+

origin: "bundled",

197+

contracts: { migrationProviders: ["hermes"] },

198+

},

199+

],

200+

}));

154201155202

const resolved = resolvePluginMigrationProvider({ providerId: "hermes" });

156203157204

expect(resolved).toBe(provider);

205+

expect(mocks.loadPluginRegistrySnapshot).toHaveBeenCalledWith({

206+

config: undefined,

207+

env: process.env,

208+

preferPersisted: false,

209+

});

158210

expect(mocks.loadPluginManifestRegistry).toHaveBeenCalledWith({

211+

index: expect.objectContaining({

212+

plugins: [expect.objectContaining({ pluginId: "migrate-hermes" })],

213+

}),

159214

config: undefined,

160215

env: process.env,

161216

includeDisabled: true,

162-

preferPersisted: false,

163217

});

164218

expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({

165219

onlyPluginIds: ["migrate-hermes"],

@@ -187,6 +241,15 @@ describe("migration provider runtime", () => {

187241

mocks.resolveRuntimePluginRegistry.mockImplementation((params?: unknown) =>

188242

params === undefined ? active : loaded,

189243

);

244+

mocks.loadPluginRegistrySnapshot.mockReturnValue(

245+

createMockPluginIndex([

246+

{

247+

pluginId: "external-migration",

248+

origin: "installed",

249+

enabled: true,

250+

},

251+

]),

252+

);

190253

mocks.loadPluginManifestRegistry.mockImplementation((params?: Record<string, unknown>) => ({

191254

diagnostics: [],

192255

plugins: params?.includeDisabled