@@ -2,11 +2,28 @@ import { describe, expect, it } from "vitest";
|
2 | 2 | import { |
3 | 3 | EXPECTED_CODEX_MODELS_COMMAND_TEXT, |
4 | 4 | EXPECTED_CODEX_STATUS_COMMAND_TEXT, |
| 5 | +isRetryableCodexHarnessLiveError, |
5 | 6 | isExpectedCodexModelsCommandText, |
6 | 7 | isExpectedCodexStatusCommandText, |
| 8 | +shouldSkipRetryableCodexHarnessLiveError, |
7 | 9 | } from "./gateway-codex-harness.live-helpers.js"; |
8 | 10 | |
9 | 11 | describe("gateway codex harness live helpers", () => { |
| 12 | +it("does not skip sessions.list timeouts when the Codex subagent probe is enabled", () => { |
| 13 | +const error = new Error("gateway request timeout for sessions.list"); |
| 14 | + |
| 15 | +expect(isRetryableCodexHarnessLiveError(error)).toBe(true); |
| 16 | +expect(shouldSkipRetryableCodexHarnessLiveError(error, { subagentProbe: false })).toBe(true); |
| 17 | +expect(shouldSkipRetryableCodexHarnessLiveError(error, { subagentProbe: true })).toBe(false); |
| 18 | +}); |
| 19 | + |
| 20 | +it("does not classify unrelated live Codex errors as retryable gateway timeouts", () => { |
| 21 | +const error = new Error("subagent child did not emit lifecycle event"); |
| 22 | + |
| 23 | +expect(isRetryableCodexHarnessLiveError(error)).toBe(false); |
| 24 | +expect(shouldSkipRetryableCodexHarnessLiveError(error, { subagentProbe: false })).toBe(false); |
| 25 | +}); |
| 26 | + |
10 | 27 | it("accepts the current codex status prose from the live harness", () => { |
11 | 28 | const text = |
12 | 29 | "OpenClaw is running on `openai/gpt-5.5` with low reasoning/text settings. Context is at `22k/272k` tokens, no compactions, and the current session is `agent:dev:live-codex-harness`."; |
|