mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
## Why OAuth token endpoints can report an unusable refresh token with the standard `invalid_grant` error instead of a legacy expired, reused, or revoked subtype. ## What changed - Classify `400 Bad Request` responses with an `invalid_grant` error code as permanent refresh failures, preserving the generic failure reason. - Cache that failure so subsequent refresh attempts do not repeat the request. - Keep other `400 Bad Request` errors transient and retryable. ## Testing Added refresh tests covering terminal `invalid_grant` responses and retryable `invalid_request` responses. GitOrigin-RevId: 513d34b514a7e4118a70c76e9d0fe779c006d5d8