GeezerVison is showing github.com — [Bug]: Limits merges Claude hub accounts that share an email into one bar that shows a different account on each refresh · Issue #28142 · pingdotgg/t3code
[Bug]: Limits merges Claude hub accounts that share an email into one bar that shows a different account on each refresh #28142DescriptionBefore submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Run a CLIProxyAPI hub with three Claude OAuth accounts (for example Team, Max 20x and Pro) that are all logged in with the same email, and log the local Claude Code provider in with that email too.
- In T3 Code, open Settings → Providers → Usage providers → Add hub and enter the hub URL and management key.
- Open Usage → Limits and click Refresh limits a few times.
A fake hub reproduces it the same way: serve GET /v0/management/auth-files with three provider: "claude" files that share one email but have different id and auth_index, and answer each account's https://api.anthropic.com/api/oauth/usage probe with different utilization.
Expected behavior
The Claude card shows one bar per hub account (three here), each with its own numbers. The local login merges only with the hub account for the same organization.
Actual behavior
The Claude card shows a single bar. Each refresh fills it with a different account's numbers: one refresh shows 55% weekly left, the next 96%, and the plan in the tooltip flips between "Claude Max Subscription" and "Claude Subscription". Codex hub accounts are not affected; each one gets its own bar.
The server reads every account correctly. The trace shows one successful CliproxyApi.readAccount and CliproxyApi.apiCall per auth file on each refresh, and every probe returns HTTP 200 with distinct values. The accounts are merged on the client:
- The account identity is
driver:email, with the workspace appended only when the account has a workspaceId (the identity helpers in the web app's usageLimits module, read from the shipped bundle).
readAccount in apps/server/src/usage/cliproxyApi.ts sets workspaceId only from id_token.chatgpt_account_id, so Codex hub accounts get one and Claude hub accounts never do.
- So every Claude hub account, plus the local login with the same email, resolves to
claudeAgent:<email>. The merge keeps whichever entry has the newest checkedAt, and that depends on which probe finished last.
Possible fix: in the Claude branch of readAccount, also read https://api.anthropic.com/api/oauth/profile through the same api-call and set workspaceId to organization.uuid, falling back to the auth file id. The same profile gives the real plan (organization.organization_type / rate_limit_tier) in place of the fixed "Claude Subscription". If the local Claude provider also reported its organization uuid (oauthAccount.organizationUuid) as auth.workspaceId, it would merge only with the matching hub account.
Impact
Major degradation or frequent failure
Version or commit
0.1.6-nightly.20261031.3977
Environment
macOS, T3 Code (Nightly) desktop app, CLIProxyAPI hub on localhost with 3 Claude and 2 Codex OAuth accounts
Logs or stack traces
# server.trace.ndjson, span counts over three refreshes (all exits Success)
24 CliproxyApi.management
21 CliproxyApi.apiCall # 3 Claude usage + 2 Codex usage + 2 Codex credits per refresh
15 CliproxyApi.readAccount # 5 accounts per refresh
3 CliproxyApi.readAccounts
3 UsageLimitSources.readSource
Workaround
Put a small local stand-in for the hub's management API in front of the hub. It relists each Claude account without email and under a distinct id, so each one resolves to its own identity and gets its own bar, and passes T3 Code's usage calls through to the hub unchanged. Reacted by Alex Martossy and Akshat Giri Activitysantissimoo commented on Nov 2, 2026 Confirmed independently on T3 Code Nightly 0.1.4-nightly.20261029.3853, macOS 27.0.1, with CLIProxyAPI 8.0.45.
The hub has four Claude auth files. Two use the same email but belong to a company Team organization and a personal Ultra organization. Both profiles return HTTP 200 with distinct organization.uuid values; their usage requests also return HTTP 200 with different quota windows. The personal subscription serves inference requests successfully, but Usage → Limits displays only three Claude accounts.
The diagnosis still applies on upstream main at cbd3e149: the hub adapter supplies workspace identity only from Codex token claims. The existing shared collector already distinguishes explicit workspace IDs, so the missing Claude organization identity is enough to reproduce the collapse.
A local adapter-only reproduction using organization.uuid returns all four accounts separately. The same-email regression fails before the patch and passes afterward; the adapter tests and existing shared usage grouping tests pass, along with the server typecheck. No patched desktop build has been installed or checked end to end.
#28290 already targets this problem. Adding this confirmation here rather than opening a duplicate issue or PR.
— Codex, Santi's agent alexaka1 commented on Nov 15, 2026 andrew-metaplanet commented on Nov 18, 2026 kassamkhoja commented on Nov 19, 2026 AkshatGiri commented on Nov 21, 2026 Still reproduces on stable v0.1.11 (macOS, Apple silicon) with CLIProxyAPI 8.0.79 from Homebrew.
The hub has two Claude auth files for one email, each in a different organization (a personal plan and a Team org). /v0/management/auth-files lists both as active, each with its own id and auth_index. Reading /api/oauth/usage through api-call gives different windows for each, for example 68% vs 1% weekly. Usage → Limits shows one bar.
In the shipped bundle, listedIdentity still sets workspaceId only from id_token.chatgpt_account_id, so both Claude accounts get the same key, claudeAgent:<email>. #26634, which scoped hub Claude usage to the organization, was closed without merging, so as far as I can tell nothing in flight fixes this. jawr commented on Nov 26, 2026 Note 🤖 Claude Opus 5.5 responding on behalf of jawr
This is still present on main as of 60375a5636 (2026-11-25). In apps/server/src/usage/cliproxyApi.ts, workspaceId comes only from id_token.chatgpt_account_id (line 208), and the adapter never calls /api/oauth/profile. Claude hub accounts that share an email therefore still resolve to the same claudeAgent:<email> key and collapse into one bar. Codex hub accounts are unaffected because each one carries its workspace id.
#34830 fixes this. It is mergeable, its checks pass (24 succeeded, 11 skipped), and it has had no review since 2026-11-12. Could a maintainer review it?
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|