Share one managed refresh and confirm rejection with the provider - #143
Merged
Merged
Conversation
Switch, manual quota refresh, and Wake each ran their own isolated token refresh and classified its failure differently, so the same dead saved sign-in was "needs sign-in" in Wake, "temporarily unavailable" in Switch, and "try again later" for quota. Codex does not report a refresh outcome in a supported form: 0.144.5 answers account/read from its cached account after a failed refresh, and 0.159.2 rejects the read without a typed reason. Use one shared refresh that never reads the outcome from that reply. It keeps a rotated same-identity credential immediately, then the caller repeats its own provider request once. Only a second 401 or 403 marks the account as needing sign-in; an App Server that cannot start or answer, and every non-authentication provider failure, stay "unavailable". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With Codex 0.159.2, v1.0.19 reports a saved sign-in whose refresh token no longer works as "temporarily cannot verify … retry when the connection is available" on Switch, and as "try again later" on a manual quota refresh. Only Wake reported it as needing sign-in. Each path ran its own isolated refresh and classified its failure separately.
Codex does not report a refresh outcome in a supported form. Read from the app-server source at both tags:
rust-v0.144.5(minimum supported):account/read {refreshToken: true}discards the refresh result and answers from the cached account.rust-v0.159.2(installed here): the refresh result is still discarded; the workspace discovery that follows fails with-32603for a rejected refresh and for a network failure alike.Switch, manual quota refresh, and Wake now share
quota::refresh_saved_sign_in:A second 401 or 403 is the confirmed rejection and marks the account as needing sign-in. An App Server that cannot start or answer, an unreadable profile, and every non-authentication provider failure stay "unavailable". The typed failure is
Unavailable,IdentityChanged, orNotSaved { recovery_retained }.Other behavior changes:
account/rateLimits/readin the isolated profile.docs/workflows.mdgains a Managed refresh section;docs/architecture.md,docs/security.md, anddocs/testing.mdare updated.Validation
pnpm run ci:source linuxon Windows: formatting, Clippy with-D warnings, 147 Rust tests passed, 1 existing ignored test, version check, and frontend build.account_needs_sign_inand leaves the saved credential untouched; 401 then 429/500/malformed returnstarget_check_unavailableand keeps the rotated credential; each typed refresh failure maps to its switch and Wake result; another identity is never saved.Limits
🤖 Generated with Claude Code