Skip to content

Commit 906e342

Browse files
committed
Add Codex multi-agent migration coverage
1 parent b8d08f0 commit 906e342

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

src/commands/doctor/shared/codex-route-warnings.test.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,6 +2925,54 @@ describe("collectCodexRouteWarnings", () => {
29252925
expect(result.cfg.plugins?.entries?.codex?.enabled).toBe(true);
29262926
});
29272927

2928+
it("repairs live multi-agent Codex upgrade configs and enables Codex through allowlists", () => {
2929+
const result = maybeRepairCodexRoutes({
2930+
cfg: {
2931+
plugins: {
2932+
allow: ["brave", "discord", "whatsapp"],
2933+
entries: {
2934+
brave: { enabled: true },
2935+
discord: { enabled: true },
2936+
whatsapp: { enabled: true },
2937+
},
2938+
},
2939+
agents: {
2940+
defaults: {
2941+
model: "openai-codex/gpt-5.5",
2942+
},
2943+
list: [
2944+
{ id: "main", model: "openai-codex/gpt-5.5" },
2945+
{ id: "meimei", model: "openai-codex/gpt-5.5" },
2946+
{ id: "youyou-cli", model: "openai-codex/gpt-5.5" },
2947+
],
2948+
},
2949+
} as unknown as OpenClawConfig,
2950+
shouldRepair: true,
2951+
});
2952+
2953+
expect(result.warnings).toStrictEqual([]);
2954+
expect(result.cfg.agents?.defaults?.model).toBe("openai/gpt-5.5");
2955+
expect(result.cfg.agents?.list?.map((agent) => agent.model)).toEqual([
2956+
"openai/gpt-5.5",
2957+
"openai/gpt-5.5",
2958+
"openai/gpt-5.5",
2959+
]);
2960+
expect(result.cfg.agents?.defaults?.models?.["openai/gpt-5.5"]?.agentRuntime).toEqual({
2961+
id: "codex",
2962+
});
2963+
for (const agent of result.cfg.agents?.list ?? []) {
2964+
expect(agent.models?.["openai/gpt-5.5"]?.agentRuntime).toEqual({ id: "codex" });
2965+
}
2966+
expect(result.cfg.plugins?.entries?.codex?.enabled).toBe(true);
2967+
expect(result.cfg.plugins?.allow).toEqual(["brave", "discord", "whatsapp", "codex"]);
2968+
expect(result.changes.join("\n")).toContain(
2969+
"agents.defaults.model: openai-codex/gpt-5.5 -> openai/gpt-5.5.",
2970+
);
2971+
expect(result.changes.join("\n")).toContain(
2972+
"agents.list.main.model: openai-codex/gpt-5.5 -> openai/gpt-5.5.",
2973+
);
2974+
});
2975+
29282976
it("keeps repaired OpenAI refs on Codex runtime even when the OpenAI provider is otherwise OpenClaw/API-key routed", () => {
29292977
const result = maybeRepairCodexRoutes({
29302978
cfg: {

0 commit comments

Comments
 (0)