Fix false-positive Claude connection status#111
Merged
hamzamerzic merged 1 commit intoJul 22, 2026
Conversation
hamzamerzic
force-pushed
the
fix/claude-auth-status-20260722
branch
from
July 22, 2026 11:55
83d7204 to
ecb7824
Compare
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
Production symptom
A production Claude credential file retained OAuth metadata/scopes but had no access token, no refresh token, and an expiry of zero. The provider-status endpoint nevertheless returned configured/authenticated=true because the preflight checked only for file existence. A subsequent Claude turn failed authentication; switching that chat to Codex recovered it. No chat message content is included here.
This change is a local predicate only. It does not probe Anthropic or change token-refresh behavior.
Validation
82 focused backend tests passed after rebasing on current main, covering the auth predicate and status route, non-UTF-8 chat-preflight terminal cleanup, terminal completion, chat-writer activation, model registry, and chat agent settings. Cases include empty, malformed JSON, malformed encoding, current-access, legacy refreshable, future-expiring refreshable, expired-access/unrefreshable, and explicitly expired refresh-token credentials.
Residual risk
A revoked but unexpired (or legacy expiry-less) refresh token continues to count as configured until a refresh is attempted. Detecting revocation here would require a remote token probe, which is intentionally outside this passive status path.