From 31ed93ff58db4b4b12ee7c47124c7a5fb0c9e3e5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 3 May 2026 04:13:15 +0100 Subject: [PATCH] test(codex): accept current status prose --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 7 +++++++ src/gateway/gateway-codex-harness.live-helpers.ts | 7 +++++++ 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 1deb206af82..b0be0c4928f 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -61,6 +61,13 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexStatusCommandText(text)).toBe(true); }); + it("accepts running-session status prose emitted by current codex", () => { + const text = + "Session is running on `codex/gpt-5.5` with low reasoning, direct execution, and about `24k/272k` context used. Cache hit is `99%`; no compactions so far."; + + expect(isExpectedCodexStatusCommandText(text)).toBe(true); + }); + it("accepts the current status card emitted by OpenAI Codex", () => { const text = [ "Current session status:", diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index e34d8218c0a..2a96c458bfb 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -122,10 +122,17 @@ export function isExpectedCodexStatusCommandText(text: string): boolean { normalized.includes("session status: running on") && normalized.includes("context at") && mentionsModel; + const isRunningSessionStatus = + normalized.includes("session is running on") && + normalized.includes("context used") && + normalized.includes("cache hit") && + normalized.includes("no compactions") && + mentionsModel; return ( isCurrentSessionStatus || isCompactSessionStatus || + isRunningSessionStatus || (mentionsOpenClawStatus && mentionsHarnessSession && mentionsModel) ); }