From dfc14d1653631fcf3ebe1174867e7751f49d22d8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 04:27:20 +0100 Subject: [PATCH] test: accept current codex status wording --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 10 ++++++++++ src/gateway/gateway-codex-harness.live-helpers.ts | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index f06e2914964..c1c5410342f 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -27,6 +27,16 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexStatusCommandText(text)).toBe(true); }); + it("accepts current status prose that reports healthy session context without the session id", () => { + const text = [ + "Status: running on `openai/gpt-5.5` with low reasoning/text settings.", + "", + "Session context is healthy: `22k/272k` tokens used, `0` compactions, `53%` cache hit. Current workspace is `/tmp/openclaw-live-codex-harness/workspace/dev`.", + ].join("\n"); + + expect(isExpectedCodexStatusCommandText(text)).toBe(true); + }); + it("accepts current app-server status prose without the OpenClaw prefix", () => { const text = [ "Status: running on `openai/gpt-5.5` in `/tmp/openclaw-live-codex-harness/workspace/dev`.", diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index 265bbbea61c..4498c482cf4 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -79,6 +79,7 @@ export const EXPECTED_CODEX_STATUS_COMMAND_TEXT = [ "Session: agent:dev:live-codex-harness", "OpenClaw `", "OpenClaw status:", + "Status: running on", "model `codex/", "session `agent:dev:live-codex-harness`", "Model/status card shown above", @@ -99,6 +100,7 @@ export function isExpectedCodexStatusCommandText(text: string): boolean { normalized.includes("session `agent:dev:live-codex-harness`") || normalized.includes("current session is `agent:dev:live-codex-harness`") || normalized.includes("current session is agent:dev:live-codex-harness") || + normalized.includes("session context is healthy") || ((normalized.includes("session context") || normalized.includes("context is at")) && normalized.includes("active task: `/codex status`")); const mentionsModel =