From bed0e076205cc040416c588645e7b7cd444d5413 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 15 Feb 2026 23:12:28 +0000 Subject: [PATCH] fix(cli): clear plugin manifest cache after install --- src/cli/plugins-cli.ts | 6 ++++++ src/plugins/manifest-registry.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/cli/plugins-cli.ts b/src/cli/plugins-cli.ts index 3d3a33411..5f897351c 100644 --- a/src/cli/plugins-cli.ts +++ b/src/cli/plugins-cli.ts @@ -9,6 +9,7 @@ import { resolveStateDir } from "../config/paths.js"; import { resolveArchiveKind } from "../infra/archive.js"; import { installPluginFromNpmSpec, installPluginFromPath } from "../plugins/install.js"; import { recordPluginInstall } from "../plugins/installs.js"; +import { clearPluginManifestRegistryCache } from "../plugins/manifest-registry.js"; import { applyExclusiveSlotSelection } from "../plugins/slots.js"; import { resolvePluginSourceRoots, formatPluginSourceForTable } from "../plugins/source-display.js"; import { buildPluginStatusReport } from "../plugins/status.js"; @@ -591,6 +592,9 @@ export function registerPluginsCli(program: Command) { defaultRuntime.error(result.error); process.exit(1); } + // Plugin CLI registrars may have warmed the manifest registry cache before install; + // force a rescan so config validation sees the freshly installed plugin. + clearPluginManifestRegistryCache(); let next = enablePluginInConfig(cfg, result.pluginId); const source: "archive" | "path" = resolveArchiveKind(resolved) ? "archive" : "path"; @@ -640,6 +644,8 @@ export function registerPluginsCli(program: Command) { defaultRuntime.error(result.error); process.exit(1); } + // Ensure config validation sees newly installed plugin(s) even if the cache was warmed at startup. + clearPluginManifestRegistryCache(); let next = enablePluginInConfig(cfg, result.pluginId); next = recordPluginInstall(next, { diff --git a/src/plugins/manifest-registry.ts b/src/plugins/manifest-registry.ts index 9dc3102a6..fce573baf 100644 --- a/src/plugins/manifest-registry.ts +++ b/src/plugins/manifest-registry.ts @@ -61,6 +61,10 @@ const registryCache = new Map