mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 18:04:45 +00:00
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:
committed by
Peter Steinberger
parent
d1787b73db
commit
0204c522bb
@@ -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 () => {
|
||||
|
||||
@@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user