[Bug]: Pooled Limits average accounts evenly, ignoring plan size (Pro 20x counts the same as Plus)#13110

openedSep 22, 2026byOomar7550

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

packages/contracts or packages/shared

Steps to reproduce

  1. Add a CLIProxyAPI usage-limit source that holds two Codex accounts on different plans: one ChatGPT Pro 20x, one ChatGPT Plus.
  2. Use most of the Pro 20x account's weekly quota and leave the Plus account untouched.
  3. Open Usage → Limits and look at the pooled Codex Weekly row.

Expected behavior

The pooled figure weights each account by its plan's capacity. Pro 20x holds 20 of the pool's 21 parts (~95%) and Plus holds 1 (~5%). With Pro 20x fully used and Plus unused, the pool should show about 5% left. The "+X% in …" reset hint should say the Pro reset restores about 95%.

Actual behavior

poolWindows in packages/shared/src/usageLimits.ts averages members evenly:

ts
1const usedPercent = members.reduce((sum, m) => sum + m.window.usedPercent, 0) / members.length;
2// ...
3restoresPercent: Math.round(member.window.usedPercent / members.length),

As a result, the same scenario shows 50% left, and each reset claims to restore up to 50% of the pool. Pace (timedUsed / meanElapsed) uses the same unweighted means. The plan multiplier is already on every account (LimitAccount.plan, e.g. ChatGPT Pro 20x Subscription, Max 5x); the pool maths just ignores it. Web, mobile, and the mobile widget all use collectLimitPools, so all three show the wrong figure.

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Alpha) 0.0.42; code checked at 17e34773 on main

Environment

macOS, local CLIProxyAPI hub with Codex Pro 20x + Codex Plus accounts