GeezerVison is showing github.com — fix(usage): pooled limits count accounts with a spent weekly as empty by AlexChambers · Pull Request #20007 · pingdotgg/t3code
Conversation
Problem
Usage → Limits pools each window on its own. Once an account's weekly limit is used up, the provider refuses every request until the weekly reset, but the pooled Session row (and Claude's per-model weekly rows) still count that account's session as available. With one of four Claude accounts at 0% weekly, Session said 95% left when 73% was usable.
Expected: an account at a used-up weekly adds nothing to Session or a per-model weekly until its weekly resets.
To reproduce: sign in two or more Claude or Codex accounts, use up one account's weekly limit, and open Usage → Limits. Session still counts that account's session headroom.
Change
In poolMember (packages/shared/src/usageLimits.ts), an account counts as empty in a window while a broader limit that also counts its usage is used up: Claude's session and per-model weeklies by its all-models weekly, and Codex's session by its weekly. Other providers are unchanged. Accounts with any weekly left keep their real numbers; capping with min(session, weekly) would mix units, since the two are shares of different-sized allowances (see the issue).
A held account's countdown is the reset that actually frees it, and its refill and hatching count only quota that becomes usable. Web and mobile draw the shared result and show a lock plus a "Limited by" line, so the 0% doesn't silently contradict the provider's session meter.
Scope and approval
Fixes #19035. This is the smaller resubmission of #19152, which was closed for size: 354 lines including tests, down from 762. To get there I dropped the widget tweak, Antigravity, and the extra explanatory copy, and cut the tests to the cases that matter. The issue hasn't been triaged yet. This is a focused display fix: no server, contract, settings, or quota-enforcement changes.
Verification
vp test run packages/shared/src/usageLimits.test.ts apps/mobile/src/widgets/subscriptionUsageSnapshot.test.ts: 73/73 pass. New cases cover the issue's example, weeklies with headroom staying unheld, a weekly that resets before its session, a session spent past its weekly, and Codex held while Cursor is not.
- Typecheck for shared, web, and mobile, and lint on the changed files: clean.
- Manual check against four real Claude accounts (renamed), one at 0% weekly. These were taken on fix(usage): accounts at their weekly limit no longer inflate pooled limits #19152; the bars are unchanged in this version.
Before (main): Session 95% |
After: Session 73%, Spare 0% with a lock |
 |
 |
Android before (main) |
Android after |
 |
 |
Not checked: iOS (this machine's Xcode lacks the iOS 27.1 SDK the dev client needs). It renders the same component as Android.
Implemented with GPT-6.1-Sol (Codex) and Claude Opus 5.5 (Claude Code) in T3 Code, reviewed with GPT-6-Astra.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
An account whose weekly limit is used up cannot spend its session or
per-model headroom, but the pooled Limits view still counted it. For
Claude and Codex, such an account now counts as empty in those rows,
shows a lock with a countdown to the reset that frees it, and its hatch
and refill only count quota that becomes usable.
Fixes pingdotgg#19035
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Needs Human Approval
Macroscope's review found this PR not approvable — This PR changes shared pooled usage accounting for Claude and Codex, including effective availability, reset timing, and refill amounts shown across web and mobile. Because those calculations affect quota and entitlement-facing metering behavior, the change warrants human review despite its focused scope and targeted tests.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f6f145df-6532-40e5-8a0b-4080f0873d3c
📥 Commits
-
Reviewing files that changed from the base of the PR and between b907b39 and bc317e6.
📒 Files selected for processing: 4
-
apps/mobile/src/features/usage/UsageLimitsPooled.tsx
apps/web/src/components/usage/UsageLimitsPooled.tsx
packages/shared/src/usageLimits.test.ts
packages/shared/src/usageLimits.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
-
Pooled usage calculations now treat a session or model window as empty when a spent broader window holds it at zero. Web and mobile displays use the effective quota and relevant reset time. Tests cover binding-window cases, and the usage guide describes the weekly-limit display.
Changes: Pooled usage limits
| Layer / File(s) |
Summary |
Effective quota and pool aggregation packages/shared/src/usageLimits.ts, packages/shared/src/usageLimits.test.ts |
Pool members include effective remaining quota, a holding window, and quota available after reset. Pooled usage, pace, and reset shares use these values. Tests cover Claude and Codex binding-window cases and a non-binding Cursor window. |
Web pooled-limit display apps/web/src/components/usage/UsageLimitsPooled.tsx |
Segments, popovers, and legend rows use enriched pool members. They show effective quota, holding-window reset timing, lock indicators, and hatching for the share restored by the next reset. |
Mobile pooled-limit display and usage guidance apps/mobile/src/features/usage/UsageLimitsPooled.tsx, docs/user/usage.md |
Mobile segments and account details use effective quota and holding-window reset timing. The usage guide describes how an exhausted weekly limit appears in session and per-model rows. |
Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: extoci
Merge Risk: ⚪ Minimal · up to bc317
-
No actionable merge-blocking issue was established for the pooled usage display change. It is mergeable after normal checks.
Security architecture risk: ⚪ Minimal · up to bc317
-
The change corrects quota estimates and explanations without changing account permissions, request authorization, or stored limits. No material security risk was found in the changed behavior.
Retained concerns
No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The changed calculations can affect displayed quota, pace, and refill estimates across accounts already present in the selected usage views, including the mobile widget. Traced consumers do not use these values to grant service access or select credentials.
Trust Boundaries and Controls
- observed — The pooled-member refactor preserves reset-credit targeting through the existing account redemption environment and input. Web redemption still requires explicit confirmation and retains its provider-management permission gate; mobile continues passing the same account redemption identity to ResetCredits.
Resilience and Maintainability Implications
- observed — Pooling builds new local collections and derived member objects without changing source account/window data. Countdown expiry is a displayed projection, not a persisted quota reset or an authorization transition, so repeated or interrupted rendering does not introduce a partially committed quota operation.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title is concise, uses conventional commit format, and clearly identifies the main change: pooled limits treat accounts with exhausted weekly limits as empty. |
| Description check |
 |
The description includes all required sections: problem, change, scope and approval, and verification. It provides reproduction details, implementation scope, linked issue context, test results, scree… |
| Linked Issues check |
 |
Issue #19035 is directly linked. In packages/shared/src/usageLimits.ts, poolMember sets Claude session and model-weekly quota to 0 when the all-models weekly is spent. It sets Codex session quota … |
| Out of Scope Changes check |
 |
The changes stay within issue #19035. Shared code changes pooled Usage → Limits calculations. Web and mobile changes display the resulting held state and reset restoration. Tests and the usage documen… |
Full details: Description check
-
Explanation
The description includes all required sections: problem, change, scope and approval, and verification. It provides reproduction details, implementation scope, linked issue context, test results, screenshots, and the iOS limitation.
Full details: Linked Issues check
-
Explanation
Issue #19035 is directly linked. In packages/shared/src/usageLimits.ts, poolMember sets Claude session and model-weekly quota to 0 when the all-models weekly is spent. It sets Codex session quota to 0 when a weekly window is spent. It selects the reset that frees the member, calculates quota usable after that reset, and preserves real quota when a weekly window has headroom. Pool headline, pace, reset restoration, and segment data use the effective values. Tests cover the issue example, headroom, reset ordering, unknown resets, model weeklies, and Codex versus Cursor. Web and mobile show the effective value, lock, limiting window, and countdown.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue #19035. Shared code changes pooled Usage → Limits calculations. Web and mobile changes display the resulting held state and reset restoration. Tests and the usage documentation support this behavior. No unrelated server, contract, settings, or quota-enforcement changes appear in the reviewed diff.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The pooled-limit math has several important reset-order branches. The current added cases cover a spent weekly holding a session and a fully spent session whose reset is later, but I’d add a paired case for a model-specific weekly and the all-model weekly having different reset timestamps (including one unknown resetsAt). Since poolMember() chooses the latest spent binding reset, that would help lock down which countdown and remainingAfterResetPercent are reported when those clocks disagree.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks, added in b907b39. A Fable weekly is held by Claude's all-models weekly (it's the row's only binding window), so the new table varies that weekly's clock against Fable's own reset:
- Resets before Fable's: the countdown is the weekly reset, and it restores Fable's 70% left.
- Resets after Fable's: the countdown is the weekly reset, and it restores 100%, since Fable has refilled by then.
- Unknown reset time: still held at 0%, with no countdown and no refill entry.
Picking the latest of several spent weeklies only matters for Codex, where more than one weekly-kind window can bind a session.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…d-accounts
# Conflicts:
# apps/mobile/src/features/usage/UsageLimitsPooled.tsx
# apps/web/src/components/usage/UsageLimitsPooled.tsx
# packages/shared/src/usageLimits.ts
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:L
100-499 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|