mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:40:43 +00:00
fix: preserve indexed plugin diagnostics
This commit is contained in:
@@ -238,7 +238,7 @@ describe("loadGatewayRuntimeConfigSchema", () => {
|
||||
loadGatewayRuntimeConfigSchema();
|
||||
loadGatewayRuntimeConfigSchema();
|
||||
|
||||
expect(mockLoadPluginManifestRegistry).toHaveBeenCalledTimes(3);
|
||||
expect(mockLoadPluginManifestRegistry).toHaveBeenCalledTimes(6);
|
||||
for (const call of mockLoadPluginManifestRegistry.mock.calls) {
|
||||
expect(call[0]).toMatchObject({ cache: false });
|
||||
}
|
||||
|
||||
@@ -50,6 +50,12 @@ export function loadPluginManifestRegistryForInstalledIndex(params: {
|
||||
return { plugins: [], diagnostics: [] };
|
||||
}
|
||||
const pluginIdSet = params.pluginIds?.length ? new Set(params.pluginIds) : null;
|
||||
const diagnostics = pluginIdSet
|
||||
? params.index.diagnostics.filter((diagnostic) => {
|
||||
const pluginId = diagnostic.pluginId;
|
||||
return !pluginId || pluginIdSet.has(pluginId);
|
||||
})
|
||||
: params.index.diagnostics;
|
||||
const candidates = params.index.plugins
|
||||
.filter((plugin) => params.includeDisabled || plugin.enabled)
|
||||
.filter((plugin) => !pluginIdSet || pluginIdSet.has(plugin.pluginId))
|
||||
@@ -60,6 +66,7 @@ export function loadPluginManifestRegistryForInstalledIndex(params: {
|
||||
env: params.env,
|
||||
cache: false,
|
||||
candidates,
|
||||
diagnostics: [...diagnostics],
|
||||
installRecords: extractPluginInstallRecordsFromInstalledPluginIndex(params.index),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user