From 8eac99634469b089d07d53e98bd7fd76d491aeae Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 16:11:13 +0100 Subject: [PATCH] test: accept codex sandbox approval fallback --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 7 +++++++ src/gateway/gateway-codex-harness.live-helpers.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index 58c45c42eee..a2c3c42895d 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -42,6 +42,13 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexModelsCommandText(text)).toBe(true); }); + it("accepts sandbox escalation rejection for codex models", () => { + const text = + "I couldn’t list them because `codex models` requires running outside the sandbox here, and that approval was rejected."; + + expect(isExpectedCodexModelsCommandText(text)).toBe(true); + }); + it("accepts the interactive TUI current-model summary", () => { const text = [ "`codex models` didn’t return a plain list in this environment; it dropped into the interactive TUI instead.", diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index 5b5b8f1d07e..c437c031990 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -57,6 +57,8 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { normalized.includes("fails to start") || normalized.includes("repo-local fallback") || normalized.includes("sandbox blocks") || + (normalized.includes("outside the sandbox") && + normalized.includes("approval was rejected")) || normalized.includes("interactive in this environment") || normalized.includes("sandboxed session") || normalized.includes("required user namespace") ||