Skip to content

fix(usage): locate claude in ~/.local/bin; drop stale codex tiers#132

Merged
StuBehan merged 1 commit into
mainfrom
fix/usage-probe-claude-path-codex-stale
Jul 17, 2026
Merged

fix(usage): locate claude in ~/.local/bin; drop stale codex tiers#132
StuBehan merged 1 commit into
mainfrom
fix/usage-probe-claude-path-codex-stale

Conversation

@StuBehan

Copy link
Copy Markdown
Collaborator

Two Usage-tab fixes.

Claude usage doesn't show (regression from #130)

#130 moved Claude quota onto the claude CLI, resolved via ProcessOutput.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.quota stays nil → .claude never enters availableUsageClients and 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 of claude --print --output-format json /usage is unchanged and confirmed still matches the current output.

Codex shows stale windows with past reset times (pre-existing)

CodexQuotaProbe reads the newest ~/.codex/sessions rollout and renders its rate_limits with no freshness check. When Codex hasn't run recently, the newest rollout is older than its own window, so it shows old used_percent with a reset time in the past (e.g. "resets 1 week ago" for the 5h window).

Fix: in tier(), drop a tier whose resets_at is already in the past — that window has rolled over and the captured percentage is stale. When both tiers are stale, .codex drops out of availableUsageClients (same "no current data" behaviour as an unavailable Claude).

Testing

swiftc -typecheck panel/*.swift shared/*.swift clean. Verified the live claude /usage output parses and reproduced the stale-Codex case against a 9-day-old rollout locally.

@StuBehan
StuBehan merged commit 6468b9f into main Jul 17, 2026
6 checks passed
@StuBehan
StuBehan deleted the fix/usage-probe-claude-path-codex-stale branch July 17, 2026 19:21
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