test: accept codex active-model fallback

This commit is contained in:
Peter Steinberger
2026-04-21 10:35:15 +01:00
parent e57e54e591
commit 87b81fa66f
2 changed files with 14 additions and 0 deletions

View File

@@ -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 couldnt 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);
});

View File

@@ -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;