diff --git a/src/plugins/plugin-lookup-table.test.ts b/src/plugins/plugin-lookup-table.test.ts index 7b33431b3c3..8905c6c5acb 100644 --- a/src/plugins/plugin-lookup-table.test.ts +++ b/src/plugins/plugin-lookup-table.test.ts @@ -80,6 +80,18 @@ function createIndex(plugins: readonly PluginManifestRecord[]): PluginRegistrySn }; } +const indexDiagnostic = { + level: "warn", + source: "/plugins/demo/openclaw.plugin.json", + message: "indexed warning", +} as const; + +const manifestDiagnostic = { + level: "warn", + source: "/plugins/demo/openclaw.plugin.json", + message: "manifest warning", +} as const; + describe("loadPluginLookUpTable", () => { beforeEach(() => { listPotentialConfiguredChannelIds @@ -105,10 +117,13 @@ describe("loadPluginLookUpTable", () => { }, }), ]; - const index = createIndex(plugins); + const index = { + ...createIndex(plugins), + diagnostics: [indexDiagnostic], + }; const manifestRegistry: PluginManifestRegistry = { plugins, - diagnostics: [], + diagnostics: [indexDiagnostic, manifestDiagnostic], }; loadPluginManifestRegistryForInstalledIndex.mockReturnValue(manifestRegistry); const { loadPluginLookUpTable } = await import("./plugin-lookup-table.js"); @@ -127,6 +142,7 @@ describe("loadPluginLookUpTable", () => { }); expect(table.manifestRegistry).toBe(manifestRegistry); + expect(table.diagnostics).toEqual([indexDiagnostic, manifestDiagnostic]); expect(table.byPluginId.get("telegram")?.id).toBe("telegram"); expect(table.normalizePluginId("openai-codex")).toBe("openai"); expect(table.owners.channels.get("telegram")).toEqual(["telegram"]); diff --git a/src/plugins/plugin-lookup-table.ts b/src/plugins/plugin-lookup-table.ts index 6c3ec1996c6..cf4615e8d15 100644 --- a/src/plugins/plugin-lookup-table.ts +++ b/src/plugins/plugin-lookup-table.ts @@ -148,7 +148,7 @@ export function loadPluginLookUpTable(params: LoadPluginLookUpTableParams): Plug registryDiagnostics: registryResult.diagnostics, manifestRegistry, plugins: manifestRegistry.plugins, - diagnostics: [...index.diagnostics, ...manifestRegistry.diagnostics], + diagnostics: manifestRegistry.diagnostics, byPluginId, normalizePluginId, owners,