Restore oauth-headers scrape script (fixes broken LaunchAgent / needs login)#40
Merged
Merged
Conversation
The LaunchAgent plist (com.justin.codexmeter.claude-plan-scrape) was updated to reference claude-plan-usage-oauth-headers.py while the feat/claude-oauth-headers-scrape branch was active, but the script was never merged to main. After switching back to main the LaunchAgent began failing every 15s (exit code 2) causing claude-plan-usage.json to go stale and the daemon to fall back to "needs login". Restored from feeda27 on feat/claude-oauth-headers-scrape. Verified the script reads the Claude Code OAuth token from Keychain and returns fresh session/weekly percentages via Anthropic rate-limit headers. Co-Authored-By: Claude Sonnet 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. |
…ript Both branches added the same file; only the mode differed (644 vs 755). Keeping 755 to match main. Co-Authored-By: Claude Sonnet 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.
What changed
Restores
scripts/claude-plan-usage-oauth-headers.pyto themainbranch.Why
The LaunchAgent plist (
com.justin.codexmeter.claude-plan-scrape) was updated to invoke this script whilefeat/claude-oauth-headers-scrapewas the active branch — but the script was never merged to main. After switching back to main, the LaunchAgent started failing every 15 s (exit code 2, "No such file or directory"), causingclaude-plan-usage.jsonto go stale and the daemon to fall back to its"needs login"sentinel status.How it was fixed
Restored the script from commit
feeda27onfeat/claude-oauth-headers-scrape. Verified locally:python scripts/claude-plan-usage-oauth-headers.py printreturns fresh session/weekly percentages via Anthropic rate-limit headersclaude-scrape-health.jsonshowsok: true/healthendpoint reportsplan_usage.fresh: trueReviewer notes
The script reads the Claude Code OAuth access token from the macOS Keychain (
Claude Code-credentials) and POSTs a 1-token Haiku probe toapi.anthropic.com/v1/messages, then parsesanthropic-ratelimit-unified-*response headers. This is the same approach asfeat/claude-oauth-headers-scrape; this PR just makes it available onmainso the LaunchAgent doesn't break after a branch switch.The
feat/claude-oauth-headers-scrapebranch can still be merged independently for any additional work it contains.