fix: handle missing OAuth credentials on macOS (Keychain support)#5
Merged
nathanschram merged 2 commits intomasterfrom Feb 26, 2026
Merged
fix: handle missing OAuth credentials on macOS (Keychain support)#5nathanschram merged 2 commits intomasterfrom
nathanschram merged 2 commits intomasterfrom
Conversation
On macOS, Claude Code stores OAuth credentials in the macOS Keychain, not in ~/.claude/.credentials.json. The plain-text file only exists on Linux. This caused FileNotFoundError crashes in the post-run usage footer, preventing message delivery to Telegram. - Add macOS Keychain fallback to _read_access_token() (tries file first, then `security find-generic-password` on darwin) - Catch FileNotFoundError and httpx.HTTPStatusError in _maybe_append_usage_footer() so messages are always delivered - Add 6 tests covering missing credentials, HTTP errors, Keychain fallback, and file-preferred-over-Keychain behaviour - Bump version to 0.23.2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Opus 4.6 <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
FileNotFoundErrorcrash when~/.claude/.credentials.jsondoesn't exist (macOS stores credentials in Keychain, not on disk)_read_access_token()— tries plain-text file first, thensecurity find-generic-password -s "Claude Code-credentials" -won darwin_maybe_append_usage_footer()except clause to catchFileNotFoundErrorandhttpx.HTTPStatusError— messages always delivered to Telegram even when usage data unavailableContext
On macOS, Claude Code stores OAuth credentials in the macOS Keychain and actively deletes the plain-text
.credentials.jsonfile (anthropics/claude-code#1414). Untether's usage footer was reading only the file, crashing the post-run handler before message delivery.Test plan
🤖 Generated with Claude Code