Skip to content

fix: keep Claude switcher bar on account weekly quota - #2424

Merged
steipete merged 5 commits into
steipete:mainfrom
gmkbenjamin:fix/claude-switcher-ignore-scoped-weeklies
Jul 28, 2026
Merged

fix: keep Claude switcher bar on account weekly quota#2424
steipete merged 5 commits into
steipete:mainfrom
gmkbenjamin:fix/claude-switcher-ignore-scoped-weeklies

Conversation

@gmkbenjamin

@gmkbenjamin gmkbenjamin commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Claude overview/switcher progress always tracks account Weekly (not Fable/Sonnet/Routines carve-outs).
  • Exhausted Fable no longer empties the overview bar while Weekly still has remaining.
  • Fable and other scoped lanes stay on the Claude detail card via extraRateWindows.

Closes #2423

Test plan

  • swift test --filter StatusItemControllerMenuTests
  • Exhausted Fable + Weekly remaining → switcher shows Weekly %
  • Remaining Fable tighter than Weekly → switcher still shows Weekly % (not Fable)
  • Rebuild/package: Overview Claude under-tab matches Weekly; Claude card still lists Fable only
  • Antigravity named weeklies unchanged

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Sources/CodexBarCore/UsageFetcher.swift Outdated
Comment on lines +513 to +514
case .claude:
[self.primary, self.secondary].compactMap(\.self)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 ClaudeOAuthTestsClaudeUsageFetcher.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 👍 / 👎.

user and others added 3 commits July 23, 2026 22:44
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>
@gmkbenjamin

Copy link
Copy Markdown
Contributor Author

CI failure on swift-test-macos (0, 2) was the known SpendDashboard selectDays(7) UserDefaults leak (same flake fixed in #2409). Cherry-picked 16e148ac onto this branch. Broader Disable Keychain + Claude boot work continues in #2426.

@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown

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.

@steipete
steipete merged commit 3d423b9 into steipete:main Jul 28, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Owner

Final maintainer verification completed on head a33a66b1b28f0b82e4cc4b18b205e588e42fc43f.

  • Re-read the complete diff and the current switcher-window selection path; no blocking defect or unrelated production scope found.
  • Independent autoreview completed cleanly with no actionable findings.
  • Exact-head hosted CI was fully green, including both macOS test shards, Linux builds, lint, aggregate tests, and security checks: https://github.com/steipete/CodexBar/actions/runs/30058646147
  • Focused coverage verifies that the Claude overview follows the account weekly allowance while provider-scoped weekly lanes remain available to the detailed view.

Merged as 3d423b9eb70e126f5bc822803b23bf69ca674079. Thank you, @gmkbenjamin, for the focused fix and regression coverage. PR #2426 contains the same slice and should be rebased onto current main before any further work.

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.

Claude overview switcher bar empty while Weekly quota remains

2 participants