auth: refresh login JWT for `auth status` / `logout` (no false re-login)

main

Commit

toothbrush3mo ago

status/logout resolved the active context's bearer with a raw keyring read (LoginTokenForContext), so an expired-but-refreshable session reported "re-login" — the exact false negative COR-389 fixed for control-plane commands, leaving entire activity (silently refreshes) inconsistent with entire auth status (told you to re-login) for the same token.

resolveStatusTarget now resolves the active context through a refreshing provider (auth.RefreshedLoginToken), falling back to the stored token when refresh fails so a genuinely dead session (ErrReauthRequired → expired token → /me 401) still surfaces "no longer valid". logout benefits too: the refreshed bearer authenticates the revoke call instead of failing on an expired token.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 2806fe7e05e7

Checkpoints

Auth Refactoring and Discovery Caching

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1