Skip to content

fix: classify RPC authentication failures as expired in check_auth - #306

Closed
taylorSando wants to merge 2 commits into
jacob-bd:mainfrom
taylorSando:fix/check-auth-rpc-auth-classification
Closed

fix: classify RPC authentication failures as expired in check_auth#306
taylorSando wants to merge 2 commits into
jacob-bd:mainfrom
taylorSando:fix/check-auth-rpc-auth-classification

Conversation

@taylorSando

Copy link
Copy Markdown

Problem

#301 introduced ClientAuthenticationError to distinguish an unreachable backend from expired authentication, but check_auth's live probe still only catches the older AuthenticationError. 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 as network_error: ClientAuthenticationError instead of expired — 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_auth so ClientAuthenticationError maps to the same expired result as AuthenticationError.

Testing

  • New regression test: tests/core/test_auth_check.py::TestCheckAuthAPI::test_check_auth_classifies_client_rpc_auth_error_as_expired — fails on main (f26bf51) with network_error: ClientAuthenticationError, passes with this change (expired).
  • Full suite on this branch: 1434 passed, 38 skipped.

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
@taylorSando

Copy link
Copy Markdown
Author

Withdrawn.

@taylorSando
taylorSando deleted the fix/check-auth-rpc-auth-classification branch August 22, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant