From d86ad7a61b3c7282f02ad94085561e8dcce66db1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 29 Apr 2026 00:03:08 +0100 Subject: [PATCH] test(ci): accept compact codex status output --- .../gateway-codex-harness.live-helpers.test.ts | 7 +++++++ src/gateway/gateway-codex-harness.live-helpers.ts | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index 283d7c5a28c..7c05ce31ef5 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -54,6 +54,13 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexStatusCommandText(text)).toBe(true); }); + it("accepts compact session status prose emitted by current codex", () => { + const text = + "Session status: running on `openai/gpt-5.5`, context at 24k/272k (9%), no compactions, execution mode `direct`, reasoning `low`, text `low`."; + + 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 7cd09a17ec3..53b9136037b 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -92,7 +92,8 @@ export function isExpectedCodexStatusCommandText(text: string): boolean { const mentionsOpenClawStatus = normalized.includes("openclaw is running on") || normalized.includes("openclaw status:") || - normalized.includes("status: running on"); + normalized.includes("status: running on") || + normalized.includes("session status: running on"); const mentionsHarnessSession = normalized.includes("session: `agent:dev:live-codex-harness`") || normalized.includes("session: agent:dev:live-codex-harness") || @@ -113,9 +114,15 @@ export function isExpectedCodexStatusCommandText(text: string): boolean { normalized.includes("current session status:") && normalized.includes("runtime: `openai codex`") && mentionsModel; + const isCompactSessionStatus = + normalized.includes("session status: running on") && + normalized.includes("context at") && + mentionsModel; return ( - isCurrentSessionStatus || (mentionsOpenClawStatus && mentionsHarnessSession && mentionsModel) + isCurrentSessionStatus || + isCompactSessionStatus || + (mentionsOpenClawStatus && mentionsHarnessSession && mentionsModel) ); }