From eafdbe885fd9706257ccf814bdf0c56cbea415c5 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 20:06:32 +0100 Subject: [PATCH] test: record codex route warnings --- .../shared/codex-route-warnings.test.ts | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/commands/doctor/shared/codex-route-warnings.test.ts b/src/commands/doctor/shared/codex-route-warnings.test.ts index 07982d70093..22221aaab21 100644 --- a/src/commands/doctor/shared/codex-route-warnings.test.ts +++ b/src/commands/doctor/shared/codex-route-warnings.test.ts @@ -65,11 +65,13 @@ describe("collectCodexRouteWarnings", () => { } as OpenClawConfig, }); - expect(warnings).toHaveLength(1); - expect(warnings[0]).toContain("Legacy `openai-codex/*`"); - expect(warnings[0]).toContain("agents.defaults.model"); - expect(warnings[0]).toContain("openai/gpt-5.5"); - expect(warnings[0]).not.toContain("agentRuntime.id"); + expect(warnings).toStrictEqual([ + [ + "- Legacy `openai-codex/*` model refs should be rewritten to `openai/*`.", + "- agents.defaults.model: openai-codex/gpt-5.5 should become openai/gpt-5.5.", + "- Run `openclaw doctor --fix`: it rewrites configured model refs and stale sessions to `openai/*`, moves Codex intent to provider/model runtime policy, and clears old whole-agent runtime pins.", + ].join("\n"), + ]); }); it("still warns when the native Codex runtime is selected with a legacy model ref", () => { @@ -86,9 +88,13 @@ describe("collectCodexRouteWarnings", () => { } as OpenClawConfig, }); - expect(warnings).toHaveLength(1); - expect(warnings[0]).toContain("openai/gpt-5.5"); - expect(warnings[0]).toContain('runtime is "codex"'); + expect(warnings).toStrictEqual([ + [ + "- Legacy `openai-codex/*` model refs should be rewritten to `openai/*`.", + '- agents.defaults.model: openai-codex/gpt-5.5 should become openai/gpt-5.5; current runtime is "codex".', + "- Run `openclaw doctor --fix`: it rewrites configured model refs and stale sessions to `openai/*`, moves Codex intent to provider/model runtime policy, and clears old whole-agent runtime pins.", + ].join("\n"), + ]); }); it("still warns when OPENCLAW_AGENT_RUNTIME selects native Codex with a legacy model ref", () => { @@ -105,8 +111,13 @@ describe("collectCodexRouteWarnings", () => { }, }); - expect(warnings).toHaveLength(1); - expect(warnings[0]).toContain('runtime is "codex"'); + expect(warnings).toStrictEqual([ + [ + "- Legacy `openai-codex/*` model refs should be rewritten to `openai/*`.", + '- agents.defaults.model: openai-codex/gpt-5.5 should become openai/gpt-5.5; current runtime is "codex".', + "- Run `openclaw doctor --fix`: it rewrites configured model refs and stale sessions to `openai/*`, moves Codex intent to provider/model runtime policy, and clears old whole-agent runtime pins.", + ].join("\n"), + ]); }); it("does not warn for canonical OpenAI refs", () => {