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