fix: preserve indexed plugin diagnostics

This commit is contained in:
Peter Steinberger
2026-04-26 04:17:11 +01:00
parent 862b39976d
commit b3ac316e0b
2 changed files with 8 additions and 1 deletions

View File

@@ -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 });
}

View File

@@ -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),
});
}