Skip to content

Commit 343c69d

Browse files
committed
fix: auto-enable media provider plugins
1 parent 3eb2a9d commit 343c69d

3 files changed

Lines changed: 70 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Docs: https://docs.openclaw.ai
88

99
- Channels: add Yuanbao channel docs entrance so the Tencent Yuanbao bot appears in the channel listing and sidebar navigation. (#73443) Thanks @loongfay.
1010

11+
### Fixes
12+
13+
- Plugins/media: auto-enable provider plugins referenced by `agents.defaults.imageGenerationModel`, `videoGenerationModel`, and `musicGenerationModel` primary/fallback refs, so configured Google and MiniMax media providers do not stay disabled behind a restrictive plugin allowlist. Thanks @vincentkoc.
14+
1115
## 2026.4.27
1216

1317
### Changes

src/config/plugin-auto-enable.core.test.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,49 @@ describe("applyPluginAutoEnable core", () => {
306306
expect(result.changes).toContain("codex/gpt-5.4 model configured, enabled automatically.");
307307
});
308308

309+
it("auto-enables provider plugins referenced by media generation model fallbacks", () => {
310+
const result = applyPluginAutoEnable({
311+
config: {
312+
agents: {
313+
defaults: {
314+
imageGenerationModel: {
315+
primary: "openai/gpt-image-1",
316+
fallbacks: ["google/gemini-3-pro-image-preview"],
317+
},
318+
videoGenerationModel: {
319+
primary: "openai/sora-2",
320+
fallbacks: ["google/veo-3.1-fast-generate-preview", "minimax/MiniMax-Hailuo-2.3"],
321+
},
322+
musicGenerationModel: {
323+
primary: "minimax/music-2.6",
324+
fallbacks: ["google/lyria-3-clip-preview"],
325+
},
326+
},
327+
},
328+
plugins: {
329+
allow: ["openai"],
330+
entries: {
331+
openai: { enabled: true },
332+
},
333+
},
334+
},
335+
env,
336+
manifestRegistry: makeRegistry([
337+
{ id: "openai", channels: [], providers: ["openai"] },
338+
{ id: "google", channels: [], providers: ["google"] },
339+
{ id: "minimax", channels: [], providers: ["minimax"] },
340+
]),
341+
});
342+
343+
expect(result.config.plugins?.entries?.google?.enabled).toBe(true);
344+
expect(result.config.plugins?.entries?.minimax?.enabled).toBe(true);
345+
expect(result.config.plugins?.allow).toEqual(["openai", "google", "minimax"]);
346+
expect(result.changes).toEqual([
347+
"google/gemini-3-pro-image-preview model configured, enabled automatically.",
348+
"minimax/MiniMax-Hailuo-2.3 model configured, enabled automatically.",
349+
]);
350+
});
351+
309352
it("does not auto-enable Codex when only the OpenAI plugin is explicitly enabled", () => {
310353
const result = applyPluginAutoEnable({
311354
config: {

src/config/plugin-auto-enable.shared.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,33 @@ function collectModelRefs(cfg: OpenClawConfig): string[] {
5454
refs.push(value.trim());
5555
}
5656
};
57+
const collectModelConfig = (value: unknown) => {
58+
if (typeof value === "string") {
59+
pushModelRef(value);
60+
return;
61+
}
62+
if (!isRecord(value)) {
63+
return;
64+
}
65+
pushModelRef(value.primary);
66+
const fallbacks = value.fallbacks;
67+
if (Array.isArray(fallbacks)) {
68+
for (const entry of fallbacks) {
69+
pushModelRef(entry);
70+
}
71+
}
72+
};
5773
const collectFromAgent = (agent: Record<string, unknown> | null | undefined) => {
5874
if (!agent) {
5975
return;
6076
}
61-
const model = agent.model;
62-
if (typeof model === "string") {
63-
pushModelRef(model);
64-
} else if (isRecord(model)) {
65-
pushModelRef(model.primary);
66-
const fallbacks = model.fallbacks;
67-
if (Array.isArray(fallbacks)) {
68-
for (const entry of fallbacks) {
69-
pushModelRef(entry);
70-
}
71-
}
77+
for (const key of [
78+
"model",
79+
"imageGenerationModel",
80+
"videoGenerationModel",
81+
"musicGenerationModel",
82+
]) {
83+
collectModelConfig(agent[key]);
7284
}
7385
const models = agent.models;
7486
if (isRecord(models)) {

0 commit comments

Comments
 (0)