test: accept codex sandbox approval fallback

This commit is contained in:
Peter Steinberger
2026-04-21 16:11:13 +01:00
parent 3243c14547
commit 8eac996344
2 changed files with 9 additions and 0 deletions

View File

@@ -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 couldnt 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` didnt return a plain list in this environment; it dropped into the interactive TUI instead.",

View File

@@ -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") ||