Repository navigation
Studio: offer ChatGPT Reconnect for reused or revoked refresh tokens - #16946
Conversation
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…dex CLI [skip ci]
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
When a ChatGPT subscription connection's refresh token was already used or has been revoked, OpenAI answers the refresh with refresh_token_reused or refresh_token_invalidated. Studio only recognised invalid_grant, invalid_refresh_token and refresh_token_expired as permanent, so the connection kept showing Connected, every request failed with a generic authorization error, and Reconnect was never offered.
A refresh now counts as permanently rejected for those two codes and for any 401 from the token endpoint, the same rules the Codex CLI uses. The connection is marked as needing reauthorization and the dialog offers Reconnect in browser. Network errors and 5xx answers stay retryable as before.
Tested against a real ChatGPT subscription, with one device-code sign-in per side and the refresh token then revoked through OpenAI's
/oauth/revoke:401 refresh_token_invalidated("Your session has ended. Please log in again.")connectedreauthorization_requiredThe saved access token's expiry was set to now so the refresh ran right away instead of after ~10 days; the refresh call and OpenAI's response were real.