fix: classify RPC authentication failures as expired in check_auth - #306
Closed
taylorSando wants to merge 2 commits into
Closed
fix: classify RPC authentication failures as expired in check_auth#306taylorSando wants to merge 2 commits into
taylorSando wants to merge 2 commits into
Conversation
check_auth's live probe catches AuthenticationError but not the ClientAuthenticationError introduced in jacob-bd#301, so an authentication failure surfaced by the RPC layer (e.g. RPC code 16) falls through to the generic handler and is reported as 'network_error' instead of 'expired'. Widen the except clause so both map to the expired result. Agent-Session-Id: claude-code:3aa9762d-002b-477a-a380-2e0a21d194b1 Agent-Session-Source: claude-code Agent-Profile: claude_personal Agent-Host: taylor-pc-ubuntu
Agent-Session-Id: claude-code:3aa9762d-002b-477a-a380-2e0a21d194b1 Agent-Session-Source: claude-code Agent-Profile: claude_personal Agent-Host: taylor-pc-ubuntu
Author
|
Withdrawn. |
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.
Problem
#301 introduced
ClientAuthenticationErrorto distinguish an unreachable backend from expired authentication, butcheck_auth's live probe still only catches the olderAuthenticationError. When the probe's RPC call fails with an authentication error (e.g. RPC code 16), it falls through to the generic handler and the profile is reported asnetwork_error: ClientAuthenticationErrorinstead ofexpired— so users with expired cookies are told there is a network problem rather than being prompted to re-authenticate.Fix
Widen the except clause in
check_authsoClientAuthenticationErrormaps to the sameexpiredresult asAuthenticationError.Testing
tests/core/test_auth_check.py::TestCheckAuthAPI::test_check_auth_classifies_client_rpc_auth_error_as_expired— fails onmain(f26bf51) withnetwork_error: ClientAuthenticationError, passes with this change (expired).