diff --git a/src/agents/models.profiles.live.test.ts b/src/agents/models.profiles.live.test.ts index 83bbae15c6e..53a19b0f5fa 100644 --- a/src/agents/models.profiles.live.test.ts +++ b/src/agents/models.profiles.live.test.ts @@ -175,6 +175,14 @@ function isInstructionsRequiredError(raw: string): boolean { return /instructions are required/i.test(raw); } +function isOpenAiCodexHtmlInterruption(raw: string): boolean { + const trimmed = raw.trim().replace(/^Error:\s*/i, ""); + return ( + /^(?: { } as Model), ).toBeUndefined(); }); + + it("matches OpenAI Codex HTML interruption pages", () => { + expect( + isOpenAiCodexHtmlInterruption( + 'Error: Try again', + ), + ).toBe(true); + expect(isOpenAiCodexHtmlInterruption("Error: connection reset")).toBe(false); + }); }); async function completeSimpleWithTimeout( @@ -764,6 +781,15 @@ describeLive("live models (profile keys)", () => { logProgress(`${progressLabel}: skip (instructions required)`); break; } + if ( + allowNotFoundSkip && + model.provider === "openai-codex" && + isOpenAiCodexHtmlInterruption(message) + ) { + skipped.push({ model: id, reason: message }); + logProgress(`${progressLabel}: skip (codex html interruption)`); + break; + } if (allowNotFoundSkip && isModelTimeoutError(message)) { skipped.push({ model: id, reason: message }); logProgress(`${progressLabel}: skip (timeout)`);