test: accept codex elevated execution fallback

(cherry picked from commit 26b359bebd)
This commit is contained in:
Peter Steinberger
2026-04-21 16:17:50 +01:00
parent 9a7a637117
commit f992542132
2 changed files with 8 additions and 3 deletions

View File

@@ -43,10 +43,14 @@ describe("gateway codex harness live helpers", () => {
});
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.";
const texts = [
"I couldnt list them because `codex models` requires running outside the sandbox here, and that approval was rejected.",
"I couldnt list them because the local `codex models` command requires elevated execution in this environment, and that request was rejected.",
];
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
for (const text of texts) {
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
}
});
it("accepts the interactive TUI current-model summary", () => {

View File

@@ -59,6 +59,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
normalized.includes("sandbox blocks") ||
(normalized.includes("outside the sandbox") &&
normalized.includes("approval was rejected")) ||
(normalized.includes("elevated execution") && normalized.includes("request was rejected")) ||
normalized.includes("interactive in this environment") ||
normalized.includes("sandboxed session") ||
normalized.includes("required user namespace") ||