mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
## Why HTTP 403 responses with `invalid_workspace_selected` were treated as unexpected status errors, allowing retries and compaction fallback to another model after the server rejected the selected workspace. ## What changed Recognize the code in `detail.code` or `error.code`, falling back to the `x-error-json` header when the body has no code. Classify these 403 responses as `InvalidWorkspaceSelected` and disable retries and compaction model fallback while preserving the response details and HTTP status. Other 403 responses retain their existing retry behavior. ## Testing Add coverage for body and header error codes, code precedence, HTTP and WebSocket retry behavior, and local and remote compaction during a model downshift. GitOrigin-RevId: f44a3bee5ef06e601909839868ab99cea6dd7d03