From 99c3ec15dff4ac3c6a726097679d8a519660f8be Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 16:27:54 +0100 Subject: [PATCH] test: accept codex not-approved fallback (cherry picked from commit 542086cceabea62c234d388eb74ddeee8c77e82a) --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 1 + src/gateway/gateway-codex-harness.live-helpers.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index f5b5ef1d305..1444fc035c8 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -47,6 +47,7 @@ describe("gateway codex harness live helpers", () => { "I couldn’t list them because `codex models` requires running outside the sandbox here, and that approval was rejected.", "I couldn’t list them because the local `codex models` command requires elevated execution in this environment, and that request was rejected.", "I couldn’t list them because the local `codex models` command requires host permissions here, and that escalation was rejected.", + "I couldn’t run `codex models` because the sandboxed attempt failed and the required elevated retry was not approved.", ]; for (const text of texts) { diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index b2b49ee1624..305f87bfdcd 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -57,7 +57,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { normalized.includes("fails to start") || normalized.includes("repo-local fallback") || normalized.includes("sandbox blocks") || - (normalized.includes("rejected") && + ((normalized.includes("rejected") || normalized.includes("not approved")) && (normalized.includes("sandbox") || normalized.includes("permission") || normalized.includes("permissions") ||