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>
This commit is contained in:
Gio Della-Libera
2026-05-15 22:59:05 -07:00
committed by Peter Steinberger
parent d1787b73db
commit 0204c522bb
2 changed files with 51 additions and 1 deletions

View File

@@ -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 () => {

View File

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