Skip to content

Commit 447d511

Browse files
Gio Della-LiberaCopilot
andcommitted
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 <[email protected]>
1 parent 1ef9d84 commit 447d511

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

src/config/config.plugin-validation.test.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,53 @@ describe("config plugin validation", () => {
357357
expectPathMessage(res.warnings, "plugins.entries.memory-lancedb", message);
358358
});
359359

360+
it("keeps blocked official external memory slot plugins fatal", () => {
361+
const res = validateConfigObjectWithPlugins(
362+
{
363+
agents: { list: [{ id: "pi" }] },
364+
plugins: {
365+
slots: { memory: "memory-lancedb" },
366+
entries: { "memory-lancedb": { enabled: true } },
367+
},
368+
},
369+
{
370+
env: suiteEnv(),
371+
pluginMetadataSnapshot: {
372+
manifestRegistry: {
373+
plugins: [],
374+
diagnostics: [
375+
{
376+
level: "warn",
377+
pluginId: "memory-lancedb",
378+
message: "blocked plugin candidate: fixture safety block",
379+
},
380+
],
381+
},
382+
},
383+
},
384+
);
385+
386+
expect(res.ok).toBe(false);
387+
if (res.ok) {
388+
return;
389+
}
390+
expectPathMessageIncludes(
391+
res.issues,
392+
"plugins.slots.memory",
393+
"plugin present but blocked: memory-lancedb",
394+
);
395+
expectPathMessageIncludes(
396+
res.warnings,
397+
"plugins.entries.memory-lancedb",
398+
"plugin present but blocked: memory-lancedb",
399+
);
400+
expect(
401+
res.warnings?.some((warning) =>
402+
warning.message.includes("plugin not installed: memory-lancedb"),
403+
),
404+
).toBe(false);
405+
});
406+
360407
it.runIf(process.platform !== "win32")(
361408
"reports configured blocked plugins without stale not-found wording",
362409
async () => {

src/config/validation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,11 @@ function validateConfigObjectWithPluginsBase(
15571557
memorySlot.trim() &&
15581558
!knownIds.has(memorySlot)
15591559
) {
1560+
const isMissingOfficialExternalMemorySlot = Boolean(
1561+
formatMissingOfficialExternalPluginWarning(memorySlot),
1562+
);
15601563
pushMissingPluginIssue("plugins.slots.memory", memorySlot, {
1561-
warnOnly: Boolean(formatMissingOfficialExternalPluginWarning(memorySlot)),
1564+
warnOnly: isMissingOfficialExternalMemorySlot && !findBlockedPluginDiagnostic(memorySlot),
15621565
});
15631566
}
15641567

0 commit comments

Comments
 (0)