mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
## Why If a provider keeps an SSE connection open after reporting a failure, Codex can hit the idle timeout and lose the original error and its retry advice. ## What changed End the SSE stream immediately on `response.failed` or a recognized `error` event. Classify statusless quota, plan usage, invalid prompt, and misalignment errors consistently across both event forms. Preserve `Retry-After` for overload and capacity errors, preferring error-level headers over event-level headers when both provide valid advice. ## Testing Add SSE regression tests that hold the connection open and verify immediate error delivery, terminal error handling, and retry delays. Extend WebSocket coverage for statusless errors received before the close handshake. GitOrigin-RevId: 69afd1d3b18ca3139e9b7ad98ae1481a432179f0