fix: auto-load bundled plugin capabilities from config refs

This commit is contained in:
Peter Steinberger
2026-03-26 19:14:34 +00:00
parent 8f1716ae5a
commit ab4de18982
16 changed files with 403 additions and 5 deletions

View File

@@ -24,24 +24,40 @@ describe("resolveGatewayStartupPluginIds", () => {
channels: ["discord"],
origin: "bundled",
enabledByDefault: undefined,
providers: [],
cliBackends: [],
},
{
id: "amazon-bedrock",
channels: [],
origin: "bundled",
enabledByDefault: true,
providers: [],
cliBackends: [],
},
{
id: "anthropic",
channels: [],
origin: "bundled",
enabledByDefault: undefined,
providers: ["anthropic"],
cliBackends: ["claude-cli"],
},
{
id: "diagnostics-otel",
channels: [],
origin: "bundled",
enabledByDefault: undefined,
providers: [],
cliBackends: [],
},
{
id: "custom-sidecar",
channels: [],
origin: "global",
enabledByDefault: undefined,
providers: [],
cliBackends: [],
},
],
diagnostics: [],
@@ -55,6 +71,14 @@ describe("resolveGatewayStartupPluginIds", () => {
"diagnostics-otel": { enabled: true },
},
},
agents: {
defaults: {
model: { primary: "claude-cli/claude-sonnet-4-6" },
models: {
"claude-cli/claude-sonnet-4-6": {},
},
},
},
} as OpenClawConfig;
expect(
@@ -63,7 +87,7 @@ describe("resolveGatewayStartupPluginIds", () => {
workspaceDir: "/tmp",
env: process.env,
}),
).toEqual(["discord", "diagnostics-otel", "custom-sidecar"]);
).toEqual(["discord", "anthropic", "diagnostics-otel", "custom-sidecar"]);
});
it("does not pull default-on bundled non-channel plugins into startup", () => {
@@ -77,4 +101,25 @@ describe("resolveGatewayStartupPluginIds", () => {
}),
).toEqual(["discord", "custom-sidecar"]);
});
it("auto-loads bundled plugins referenced by configured provider ids", () => {
const config = {
models: {
providers: {
anthropic: {
baseUrl: "https://example.com",
models: [],
},
},
},
} as OpenClawConfig;
expect(
resolveGatewayStartupPluginIds({
config,
workspaceDir: "/tmp",
env: process.env,
}),
).toEqual(["discord", "anthropic", "custom-sidecar"]);
});
});