fix(config): warn and ignore unknown plugin entry keys

Prevent gateway startup failures when plugins.entries contains stale or removed plugin ids by downgrading unknown entry keys from validation errors to warnings.

Made-with: Cursor
(cherry picked from commit 34ef28cf63)
This commit is contained in:
SidQin-cyber
2026-02-26 20:21:36 +08:00
committed by Peter Steinberger
parent 1ba525f94d
commit a481ed00f5
2 changed files with 20 additions and 7 deletions

View File

@@ -65,17 +65,18 @@ describe("config plugin validation", () => {
}
});
it("rejects missing plugin ids in entries", async () => {
it("warns for missing plugin ids in entries instead of failing validation", async () => {
const home = await createCaseHome();
const res = validateInHome(home, {
agents: { list: [{ id: "pi" }] },
plugins: { enabled: false, entries: { "missing-plugin": { enabled: true } } },
});
expect(res.ok).toBe(false);
if (!res.ok) {
expect(res.issues).toContainEqual({
expect(res.ok).toBe(true);
if (res.ok) {
expect(res.warnings).toContainEqual({
path: "plugins.entries.missing-plugin",
message: "plugin not found: missing-plugin",
message:
"plugin not found: missing-plugin (stale config entry ignored; remove it from plugins config)",
});
}
});