Repository navigation
Conversation
…y window Enterprise seats have no five_hour/seven_day windows, so the Claude meter stayed empty although the usage response carries the monthly spend cap. Map it to the existing monthly window in that case only, and render that window in the account switcher's inline usage rows too. Fixes stablyai#31061
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d0bba7a1-140c-4e64-89e2-f6fb487fe8c7
📒 Files selected for processing: 5
src/main/rate-limits/claude-oauth-usage-extra-usage.test.tssrc/main/rate-limits/claude-oauth-usage-request.tssrc/main/rate-limits/claude-usage-credits.tssrc/renderer/src/components/status-bar/InlineProviderUsage.tsxsrc/renderer/src/components/status-bar/inline-usage-bars.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
… percent from amounts A balance-only spend object no longer hides the cap from legacy extra_usage, and legacy utilization reported as a 0-1 fraction no longer understates the meter.
|
Thanks @frank-bee — your two commits landed (rebased) in #33655, merged with your co-author credit. Closing in favour of that. |
… has no 5h/weekly window (#33655) Claude Enterprise seats (null 5h/weekly windows, limit in spend/extra_usage) now show their spend cap as a monthly usage bar in the status bar chip, tooltip and account switcher instead of an empty meter. Fixes #31061 Supersedes #31065 Co-authored-by: Frank Bernhardt <275327+frank-bee@users.noreply.github.com>
|
Awesome!
Neil ***@***.***> schrieb am Mo., 26. Okt. 2026, 00:10:
… *nwparker* left a comment (stablyai/orca#31065)
<#31065 (comment)>
Thanks @frank-bee <https://github.com/frank-bee> — your two commits
landed (rebased) in #33655 <#33655>,
merged with your co-author credit. Closing in favour of that.
—
Reply to this email directly, view it on GitHub
<#31065?email_source=notifications&email_token=AACDG74BUCZQ54OMXS6WPZD5V2B6HA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNBQGQ3TANBQHA42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6404704089>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDG73T3MKXWMYGOIZYSS35V2B6HAVCNFSNUABGKJSXA33TNF2G64TZHMYTCOBTHA4DQMZUGI5US43TOVSTWNJZGM4DKNJVGEZTNILWAI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
ELI5
Claude Enterprise accounts don't have the usual 5-hour and weekly limits. They have a monthly spending cap instead. Orca already downloads that cap but never showed it, so the Claude meter in the status bar stayed empty. Now it shows how much of the monthly cap is used, the same way Orca shows monthly limits for Grok, Cursor and OpenCode Go.
What Changed
Before: for a Claude Enterprise login, the status bar shows only the Claude icon with no percentage or bar, even though the account is close to its limit.
After: the Claude chip shows the share of the monthly spend cap used (e.g.
83% 30d), and the usage popover lists it as "Monthly". With several Claude accounts, an inactive Enterprise account in the Claude account switcher shows the same30dbar instead of an empty row.Mechanism: the Claude usage fetcher (
claude-oauth-usage-request.ts) already maps thespend/ legacyextra_usagepart of the/api/oauth/usageresponse intoextraUsage. When the response has neither afive_hournor aseven_daywindow, the fetcher now also turns that spend into the existingmonthlywindow (mapClaudeSpendLimitWindowinclaude-usage-credits.ts). The status bar chip already renders a monthly-only provider inline. The switcher's per-account rows (InlineUsageBars) only drew 5h/weekly/Fable, so they now add the monthly bar under the same "no 5h/7d window" rule.isUnavailableInactiveUsagealso countsmonthly, so such an account isn't treated as signed out. Inactive accounts go through the same fetcher, so they get the window without further changes.Why
On Enterprise, the monthly spend cap is the only limit that applies, so an empty meter looks like "no data" when Orca has the number.
The spend is only promoted to the monthly window when there is no 5h/7d window. On Pro/Max, spend is overage that only applies after a plan limit is hit, and the existing balance display already handles that. A cap of 0, a missing percentage, or a balance without a cap produce no window, so nothing is made up. The alternative was a Claude-specific renderer branch that reads
extraUsagedirectly. Reusing themonthlywindow instead keeps the chip, popover, roster, tone and overflow logic shared with the other monthly providers.Linked Issue
Fixes #31061
Visual Proof
Before (current release, Claude Enterprise login):
After (this branch, same login):
Testing
Added 6 cases to
claude-oauth-usage-extra-usage.test.ts: spend → monthly window when there are no plan windows; the same from legacyextra_usage; legacy cap used whenspendhas only a balance; legacy percentage derived from the amounts whenutilizationis a 0–1 fraction; no monthly window when a 5h window exists; no window from a balance without a cap.Added 2 cases to
inline-usage-bars.test.tsx: an inactive account with only a monthly window renders80% used 30dand isn't treated as signed out; rows with plan windows don't add the monthly bar.pnpm test src/main/rate-limits/ src/renderer/src/components/status-bar/(1502 passed),pnpm tc:node,pnpm tc:web,oxlintandpnpm run check:code-quality:changedpass, and the files are formatted.Full
pnpm lintandpnpm typecheckpass.Full
pnpm test: 7 files fail locally (process-host-dev-rebuild,pr-auxiliary-preflight-admission,orca-runtime,packaged-cli-assetsand threepty-*race tests). They fail onmain(46d0a00) too, with the same set of files (20 failures onmain, 19 on this branch), so they're environment/timing related, not caused by this change.Ran
pnpm devon macOS (arm64) against a real Claude Enterprise login. The usage state came backstatus: ok,monthly.usedPercent: 83, and the chip rendered as shown above (status bar in the "verbose" usage mode, which shows the bars).Not tested on Linux, Windows or over SSH. The change is in shared fetch/mapping code with no platform-specific paths.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Implemented with Claude (Opus 5.5) in Claude Code. I reviewed the change and checked the result in a dev build with my own account.
Review
Agent skill upstream boundary
Notes
monthlyis an existing optional field onProviderRateLimits. Older renderers already handle it.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred): fullpnpm lintandpnpm typecheckpass;pnpm testpasses except 7 files that fail onmaintoo (see Testing);pnpm buildleft to CI