From 0204c522bb65191f94bea8dfe4f9a0466a5c99ec Mon Sep 17 00:00:00 2001 From: Gio Della-Libera Date: Fri, 15 May 2026 22:59:05 -0700 Subject: [PATCH] fix(config): keep blocked memory slots fatal Preserve hard validation failures for official external memory slot plugins that are blocked by registry diagnostics, while keeping missing uninstalled official memory plugins warning-only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/config/config.plugin-validation.test.ts | 47 +++++++++++++++++++++ src/config/validation.ts | 5 ++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/config/config.plugin-validation.test.ts b/src/config/config.plugin-validation.test.ts index f5344123944..6d43e9a28a7 100644 --- a/src/config/config.plugin-validation.test.ts +++ b/src/config/config.plugin-validation.test.ts @@ -357,6 +357,53 @@ describe("config plugin validation", () => { expectPathMessage(res.warnings, "plugins.entries.memory-lancedb", message); }); + it("keeps blocked official external memory slot plugins fatal", () => { + const res = validateConfigObjectWithPlugins( + { + agents: { list: [{ id: "pi" }] }, + plugins: { + slots: { memory: "memory-lancedb" }, + entries: { "memory-lancedb": { enabled: true } }, + }, + }, + { + env: suiteEnv(), + pluginMetadataSnapshot: { + manifestRegistry: { + plugins: [], + diagnostics: [ + { + level: "warn", + pluginId: "memory-lancedb", + message: "blocked plugin candidate: fixture safety block", + }, + ], + }, + }, + }, + ); + + expect(res.ok).toBe(false); + if (res.ok) { + return; + } + expectPathMessageIncludes( + res.issues, + "plugins.slots.memory", + "plugin present but blocked: memory-lancedb", + ); + expectPathMessageIncludes( + res.warnings, + "plugins.entries.memory-lancedb", + "plugin present but blocked: memory-lancedb", + ); + expect( + res.warnings?.some((warning) => + warning.message.includes("plugin not installed: memory-lancedb"), + ), + ).toBe(false); + }); + it.runIf(process.platform !== "win32")( "reports configured blocked plugins without stale not-found wording", async () => { diff --git a/src/config/validation.ts b/src/config/validation.ts index 6f7a8530b71..eb62fbbfad4 100644 --- a/src/config/validation.ts +++ b/src/config/validation.ts @@ -1557,8 +1557,11 @@ function validateConfigObjectWithPluginsBase( memorySlot.trim() && !knownIds.has(memorySlot) ) { + const isMissingOfficialExternalMemorySlot = Boolean( + formatMissingOfficialExternalPluginWarning(memorySlot), + ); pushMissingPluginIssue("plugins.slots.memory", memorySlot, { - warnOnly: Boolean(formatMissingOfficialExternalPluginWarning(memorySlot)), + warnOnly: isMissingOfficialExternalMemorySlot && !findBlockedPluginDiagnostic(memorySlot), }); }