pingdotgg / pingdotgg/t3code

bug: /usage-limits counts the same subscription more than once

Open
#10,701 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
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.

Image

Reproduction

  1. Configure two native Codex provider instances that resolve to the same authenticated email, such as a default instance and a proxy-backed instance.
  2. Optionally connect a CLIProxyAPI usage hub containing that account.
  3. Run /usage-limits in a Codex thread.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.