fix: keep Claude switcher bar on account weekly quota - #2424
Conversation
Ignore model-scoped Claude weeklies (Fable, Routines, Sonnet) when picking the overview progress so an exhausted carve-out no longer empties the bar while Weekly remains. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 816de62b83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case .claude: | ||
| [self.primary, self.secondary].compactMap(\.self) |
There was a problem hiding this comment.
Retain the only available Claude weekly window
When Claude returns five_hour plus seven_day_sonnet or seven_day_opus but no account-wide seven_day—a supported response shape exercised by ClaudeOAuthTests—ClaudeUsageFetcher.mapOAuthUsage stores the model weekly window in tertiary. Excluding it here leaves no 7-day candidate, so the fallback renders the 5-hour session percentage under the “Weekly progress” label. Suppress the model carve-out only when an account-wide weekly window exists; otherwise retain it as the weekly fallback.
Useful? React with 👍 / 👎.
Prefer the most-constrained Claude weekly window that still has remaining (including Fable). Only fall back to account Weekly when carve-outs are exhausted so the overview bar stays informative in both cases. Co-authored-by: Cursor <cursoragent@cursor.com>
Overview switcher ignores Fable/Sonnet/Routines carve-outs and tracks account Weekly; those scoped lanes remain on the Claude detail card. Co-authored-by: Cursor <cursoragent@cursor.com>
UsageFetcher was already at the file_length warning ceiling; moving the switcher helpers out keeps the Claude overview fix under the limit. Co-authored-by: Cursor <cursoragent@cursor.com>
Clock rollover tests called selectDays(7) on UserDefaults.standard, which leaked into later ControllerTests and, once wall-clock moved past the Jul 15 fixtures, made totalCost nil under a 7-day window. Co-authored-by: Cursor <cursoragent@cursor.com>
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: keep Claude switcher bar on account weekly quota This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Final maintainer verification completed on head
Merged as |
Summary
extraRateWindows.Closes #2423
Test plan
swift test --filter StatusItemControllerMenuTests