bug: /usage-limits counts the same subscription more than once
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Summary
/usage-limits can count one subscription more than once when multiple native provider instances are authenticated with the same provider account. The banner then reports the number of provider records as if they were distinct subscription accounts and renders identical quota windows twice.
A real example showed 3 accounts for Codex even though the connected CLIProxyAPI hub contained only two Codex auth files. The first and third rows had the same plan, weekly percentage, reset time, and reset credit because they represented the same subscription through duplicate native instances.
Reproduction
- Configure two native Codex provider instances that resolve to the same authenticated email, such as a default instance and a proxy-backed instance.
- Optionally connect a CLIProxyAPI usage hub containing that account.
- Run
/usage-limitsin a Codex thread. - Observe that the account count includes both native instances and the same limits appear twice.
Expected
Count a subscription once when its provider and normalized email match. Keep instances without an email separate because T3 cannot prove they are the same account.
Cause
collectProviderUsageLimits deduplicates CLIProxy accounts against native accounts with the existing provider-and-email identity key, but it appends every native provider instance without applying that same identity rule.
Scope note
Claude accounts not appearing in this banner is expected when the command runs in a Codex thread. /usage-limits is scoped to the current thread provider. This issue covers only the incorrect duplicate count and duplicate rows.
Proposed fix: #10700
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at collectProviderUsageLimits, then reproduce the issue with two native Codex instances resolving to the same normalized email and run /usage-limits in a Codex thread. Use the existing provider-and-email identity rule for native instances while keeping instances without an email separate; done means each matching subscription appears once and its quota window is not duplicated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100