From 87b81fa66ff652bf626b8f0688e68519d9473723 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 10:35:15 +0100 Subject: [PATCH] test: accept codex active-model fallback --- .../gateway-codex-harness.live-helpers.test.ts | 13 +++++++++++++ src/gateway/gateway-codex-harness.live-helpers.ts | 1 + 2 files changed, 14 insertions(+) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index bc84891975a..58c45c42eee 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -75,6 +75,19 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexModelsCommandText(text)).toBe(false); }); + it("accepts the sandboxed CLI failure active-model summary", () => { + const text = [ + "I couldn’t inspect the CLI model list because sandboxed `codex --help` failed on a namespace restriction, and the escalated retry was rejected.", + "", + "What I can confirm from the current session is:", + "- Active model: `codex/gpt-5.4`", + ].join("\n"); + + expect( + EXPECTED_CODEX_MODELS_COMMAND_TEXT.some((expectedText) => text.includes(expectedText)), + ).toBe(true); + }); + it("rejects unrelated codex command output", () => { expect(isExpectedCodexModelsCommandText("Codex is healthy.")).toBe(false); }); diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index a642ca0e6c0..5b5b8f1d07e 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -38,6 +38,7 @@ export const EXPECTED_CODEX_MODELS_COMMAND_TEXT = [ "This harness is configured with a single Codex model: `codex/", "Primary model: `codex/", "Registered models: `codex/", + "Active model: `codex/", "Current active model is `codex/", "Current OpenClaw session status reports the active model as:", ] as const;