fix(usage): locate claude in ~/.local/bin; drop stale codex tiers#132
Merged
Conversation
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.
Two Usage-tab fixes.
Claude usage doesn't show (regression from #130)
#130moved Claude quota onto theclaudeCLI, resolved viaProcessOutput.claude(). That list only probed/opt/homebrew/bin,/usr/local/bin, and~/.claude/local. Claude Code's current native installer symlinks the binary into~/.local/bin, which isn't on a launchd-spawned app's minimal PATH, so the probe returns nil → hard-fail →nav.quotastays nil →.claudenever entersavailableUsageClientsand the tab shows no Claude row (and no error, since other clients are present).Fix: add
~/.local/bin/claude(first) to the probe list. Parsing ofclaude --print --output-format json /usageis unchanged and confirmed still matches the current output.Codex shows stale windows with past reset times (pre-existing)
CodexQuotaProbereads the newest~/.codex/sessionsrollout and renders itsrate_limitswith no freshness check. When Codex hasn't run recently, the newest rollout is older than its own window, so it shows oldused_percentwith a reset time in the past (e.g. "resets 1 week ago" for the 5h window).Fix: in
tier(), drop a tier whoseresets_atis already in the past — that window has rolled over and the captured percentage is stale. When both tiers are stale,.codexdrops out ofavailableUsageClients(same "no current data" behaviour as an unavailable Claude).Testing
swiftc -typecheck panel/*.swift shared/*.swiftclean. Verified the liveclaude /usageoutput parses and reproduced the stale-Codex case against a 9-day-old rollout locally.