fix(coding-agent): only shadow user entry when project install is enabled

listInstalledPlugins() was marking user-scope entries as shadowedBy:
"project" based on plugin ID presence in the project registry alone.
A disabled project copy (enabled: false) is not active in discovery, so
the user copy is the effective install and must not appear shadowed.

activeProjectIds now only includes project plugins where the first entry
does not have enabled: false.
This commit is contained in:
Miroslav Drbal
2026-03-31 22:03:03 +02:00
parent b160455027
commit 5acd56a5e3
@@ -447,7 +447,15 @@ export class MarketplaceManager {
? await readInstalledPluginsRegistry(this.#opts.projectInstalledRegistryPath)
: null;
const projectIds = new Set(projectReg ? Object.keys(projectReg.plugins) : []);
// Only enabled project installs shadow user installs — a disabled project copy leaves
// the user entry as the active one and must not be reported as shadowed.
const activeProjectIds = new Set(
projectReg
? Object.entries(projectReg.plugins)
.filter(([, entries]) => entries.length > 0 && entries[0].enabled !== false)
.map(([id]) => id)
: [],
);
const results: InstalledPluginSummary[] = [];
// Project entries first
@@ -462,7 +470,7 @@ export class MarketplaceManager {
id,
scope: "user",
entries,
...(projectIds.has(id) ? { shadowedBy: "project" as const } : {}),
...(activeProjectIds.has(id) ? { shadowedBy: "project" as const } : {}),
});
}
return results;