You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Thread details Limits shows Unavailable for a Claude provider on a CLIProxyAPI endpoint, though Usage shows the account's limits #30990
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Add a Claude provider instance (driver claudeAgent) with environment ANTHROPIC_BASE_URL=http://127.0.0.1:8317 and ANTHROPIC_AUTH_TOKEN=<CLIProxyAPI client key>.
Add a usage limit source kind: "cliproxy" with the same URL and the management key. The hub has exactly one Claude OAuth account.
Open a thread on that provider, then open thread details with "Usage limits" enabled.
Expected behavior
The Limits row shows the 5h and weekly windows of the hub's Claude account, which is the account that actually serves this provider's requests.
Actual behavior
Thread details shows Limits: Unavailable.
The Usage dialog shows the same account's limits from the CLIProxyAPI source correctly (5h 32%, 7d 5% at the time).
UsageLimitSources.readSource succeeds. A manual management api-call to https://api.anthropic.com/api/oauth/usage for that account returns 200 with valid five_hour and seven_day data.
Cause, traced in the shipped 0.1.7 bundle:
The provider's own limits are always unavailable here. A non-api.anthropic.comANTHROPIC_BASE_URL makes the Claude provider auth { type: "customEndpoint" } with no email. probeClaudeCapabilities gets no usage from Claude Code in env-token mode, so the result is makeUnavailableUsageLimits({ reason: "probeFailed" }).
Source accounts are never tied to a provider instance. The report builder used by thread details, in the web usageLimits module, pushes provider entries withinstanceId and cliproxy source accounts (sourceLabel: "CLI Proxy") withoutinstanceId.
So it always falls back to step 1's unavailable limits.
Email merging can't help. The driver:email key is null because the custom-endpoint provider has no auth.email.
Suggested fix: when the thread's claudeAgent provider has auth.type === "customEndpoint" and its ANTHROPIC_BASE_URL matches an enabled cliproxy source url (after normalising scheme, host, port and trailing slash), use that source's Claude account limits in thread details:
Exactly one non-disabled Claude account: use its usageLimits.
More than one: keep Unavailable, with a tooltip saying the hub has several accounts and routing is ambiguous. Don't guess.
Same idea for codex providers pointed at a hub via OPENAI_BASE_URL.
Not covered by this fix: per-turn rate_limit_event. Claude Code doesn't emit it in env-token mode even when the proxy forwards the anthropic-ratelimit-unified-* headers (CLIProxyAPI requests.passthrough-headers: true; verified forwarded).
Impact
Minor bug or occasional failure
Version or commit
T3 Code desktop 0.1.7
Environment
Windows 11 Pro, Claude Code 2.1.318, CLIProxyAPI 8.0.44 on localhost
🤖 Opus 5.5 responding on behalf of EhsanulHaqueSiam
#27740 fixes this case. In its resolveThreadDetailsLimits (apps/web/src/components/chat/ThreadDetailsUsage.logic.ts), when the instance's own limits carry a notice (here probeFailed), the card falls back to a connected hub if exactly one hub account serves that driver, and the rows say From <hub label>. canServeInstance skips a hub account only when both sides have an email and they differ, so a customEndpoint instance with no email still matches the hub's Claude account. Codex instances take the same path.
Two differences from the suggested fix:
It matches hub accounts by driver, not by comparing ANTHROPIC_BASE_URL with the source URL.
With several accounts, an unreadable account, or a hub that fails to read, it keeps Limits: Unavailable rather than guessing.
For hubs with several accounts, #29978 (built on #27740) uses the account the hub's usage-queue recorded for the thread's session id, opt-in per hub. #30634 takes a different approach to that case.
I read #27740's code but have not run your exact setup (ANTHROPIC_BASE_URL in the provider instance's environment) against it.
This still reproduces on 0.1.9, with both the server and the Linux desktop app (t3code-bin 0.1.9-1) on that version. It affects Claude and Codex instances that go through one CLIProxyAPI hub with one account per provider.
CliproxyApi.readAccounts and UsageLimitSources.publish succeed. Usage → Limits shows both accounts.
Thread details still shows Limits: Unavailable. The 0.1.9 web bundle (_chat-*.js) still contains the lookup that matches only instanceId:
A local patch that applies the fallback described in #27740 fixes it. With it, the selection falls back to the hub's only usable account for the driver when the instance's own limits carry a notice, and skips that account if the email or workspace differs. It has to be reapplied after every update, and it can't reach the desktop app's bundled copy, so it would be good to get #27740 (or #30634) merged.
Reacted by AHMED, Ildar Abdulin, Gustavo Dominguez, cd slash and Paul Schwind
Still reproduces on 0.1.10 (t3code-bin 0.1.10-1, Linux desktop), with a Claude instance on a CLIProxyAPI endpoint (customEndpoint auth) and the hub configured as a cliproxy usage limit source. Usage → Limits shows both hub accounts correctly; thread details shows Limits: Unavailable.
One case that #27740 wouldn't cover: my hub has two Claude OAuth accounts. As I read it, #27740 falls back to the hub only when exactly one hub account serves the driver, so with two or more accounts the card would still say Unavailable. Multiple subscriptions behind one proxy is the main reason to run CLIProxyAPI, so this is probably the common setup.
The proxy picks the account for each request, so the card can't know which account served the thread (the concern raised in #30886). A way to handle that without guessing: when the instance's own limits carry a notice, show every usable hub account for that driver, with the account named on each row:
5h · account-a 90% left
7d · account-a 73% left
5h · account-b 100% left
7d · account-b 100% left
I'm running this as a local patch to the bundle, and it works well. Here's the logic in readable form (in the bundle it sits at the accounts.find(e => e.instanceId === n)?.limits ?? …usageLimits lookup):
constown=hub?.accounts.find(a=>a.instanceId===instanceId&&!limitsNotice(a.limits))?.limits;constpooled=(()=>{constaccounts=(hub?.accounts??[]).filter(a=>a.instanceId===undefined&&!limitsNotice(a.limits))// tightest account first, by remaining 5h session quota.sort((a,b)=>remaining(a,"session")-remaining(b,"session"));if(accounts.length===0)returnundefined;return{checkedAt: accounts[0].limits.checkedAt,windows: accounts.flatMap((acct,i)=>acct.limits.windows.map(w=>({
...w,id: `${i}:${acct.id}:${w.id}`,// unique even if a source lists an account twicelabel: `${w.kind==="session" ? "5h" : w.kind==="weekly" ? "7d" : w.label} · ${accountName(acct)}`,})),),};})();constlimits=own??pooled??providerInstance?.usageLimits;
Notes:
Labels are kept short (5h / 7d) because the row truncates at max-w-28, and a longer label cuts off the account name first.
Fixed by #30778, now on main: With the provider endpoint and configured CLIProxyAPI hub at the same origin, the reported single-account setup now shows the hub account's session and weekly limits in thread details instead of Unavailable.
Follow-up from a fleet setup on 2026-11-21: the latest stable 0.1.11 still has the old thread-details lookup. I understand #30778 merged after that release; this is not a claim that the merged fix regressed.
I checked whether supported configuration alone could resolve this:
The installed Linux desktop 0.1.11 bundle still selects report.accounts.find(a => a.instanceId === providerInstanceId)?.limits ?? provider.usageLimits.
UsageLimitSourceConfig has no account-to-provider-instance mapping. collectProviderUsageLimits emits hub rows without instanceId.
I exercised the installed 0.1.10 collector and menu expression with fixture snapshots containing a healthy hub account, for both Codex and Claude. With either a matching or different hub/provider origin, the menu still selects the unavailable native snapshot. Usable native limits pass as a positive control. The 0.1.11 source retains the same behavior.
There is also a configuration caveat for adopting #30778: our main Usage page aggregates a healthy central hub from one connected environment, but a thread can run on another environment with no local hub source. ChatView passes only that thread environment's sources to the card. Separately, our hub source uses a quota-cache origin (http://127.0.0.1:8318), while providers use the proxy's remote HTTPS origin. The new instanceHubs requires exact origin equality, so an upgrade alone would not repair this setup.
Is the recommended configuration to add a hub source on each execution environment at the provider's proxy origin, with management quota reads routed through the same shared cache? It would help to document both the per-environment source requirement and the origin requirement when the fix reaches stable, so users of centralized hubs know what to change.
Activity
EhsanulHaqueSiam commentedon Nov 4, 2026
Note
🤖 Opus 5.5 responding on behalf of EhsanulHaqueSiam
#27740 fixes this case. In its
resolveThreadDetailsLimits(apps/web/src/components/chat/ThreadDetailsUsage.logic.ts), when the instance's own limits carry a notice (hereprobeFailed), the card falls back to a connected hub if exactly one hub account serves that driver, and the rows sayFrom <hub label>.canServeInstanceskips a hub account only when both sides have an email and they differ, so acustomEndpointinstance with no email still matches the hub's Claude account. Codex instances take the same path.Two differences from the suggested fix:
ANTHROPIC_BASE_URLwith the source URL.For hubs with several accounts, #29978 (built on #27740) uses the account the hub's
usage-queuerecorded for the thread's session id, opt-in per hub. #30634 takes a different approach to that case.I read #27740's code but have not run your exact setup (
ANTHROPIC_BASE_URLin the provider instance's environment) against it.BlaiseBaptist commentedon Nov 12, 2026
This still reproduces on 0.1.9, with both the server and the Linux desktop app (
t3code-bin 0.1.9-1) on that version. It affects Claude and Codex instances that go through one CLIProxyAPI hub with one account per provider.CliproxyApi.readAccountsandUsageLimitSources.publishsucceed. Usage → Limits shows both accounts._chat-*.js) still contains the lookup that matches onlyinstanceId:A local patch that applies the fallback described in #27740 fixes it. With it, the selection falls back to the hub's only usable account for the driver when the instance's own limits carry a notice, and skips that account if the email or workspace differs. It has to be reapplied after every update, and it can't reach the desktop app's bundled copy, so it would be good to get #27740 (or #30634) merged.
fix(web): thread details show hub limits for proxied providers
Jairik commentedon Nov 19, 2026
Still reproduces on 0.1.10 (
t3code-bin 0.1.10-1, Linux desktop), with a Claude instance on a CLIProxyAPI endpoint (customEndpointauth) and the hub configured as acliproxyusage limit source. Usage → Limits shows both hub accounts correctly; thread details shows Limits: Unavailable.One case that #27740 wouldn't cover: my hub has two Claude OAuth accounts. As I read it, #27740 falls back to the hub only when exactly one hub account serves the driver, so with two or more accounts the card would still say Unavailable. Multiple subscriptions behind one proxy is the main reason to run CLIProxyAPI, so this is probably the common setup.
The proxy picks the account for each request, so the card can't know which account served the thread (the concern raised in #30886). A way to handle that without guessing: when the instance's own limits carry a notice, show every usable hub account for that driver, with the account named on each row:
I'm running this as a local patch to the bundle, and it works well. Here's the logic in readable form (in the bundle it sits at the
accounts.find(e => e.instanceId === n)?.limits ?? …usageLimitslookup):Notes:
5h/7d) because the row truncates atmax-w-28, and a longer label cuts off the account name first.canServeInstance.fix(web): thread details show hub limits for proxied providers
juliusmarminge commentedon Nov 21, 2026
Fixed by #30778, now on main: With the provider endpoint and configured CLIProxyAPI hub at the same origin, the reported single-account setup now shows the hub account's session and weekly limits in thread details instead of Unavailable.
BlaiseBaptist commentedon Nov 21, 2026
Follow-up from a fleet setup on 2026-11-21: the latest stable 0.1.11 still has the old thread-details lookup. I understand #30778 merged after that release; this is not a claim that the merged fix regressed.
I checked whether supported configuration alone could resolve this:
report.accounts.find(a => a.instanceId === providerInstanceId)?.limits ?? provider.usageLimits.UsageLimitSourceConfighas no account-to-provider-instance mapping.collectProviderUsageLimitsemits hub rows withoutinstanceId.There is also a configuration caveat for adopting #30778: our main Usage page aggregates a healthy central hub from one connected environment, but a thread can run on another environment with no local hub source.
ChatViewpasses only that thread environment's sources to the card. Separately, our hub source uses a quota-cache origin (http://127.0.0.1:8318), while providers use the proxy's remote HTTPS origin. The newinstanceHubsrequires exact origin equality, so an upgrade alone would not repair this setup.Is the recommended configuration to add a hub source on each execution environment at the provider's proxy origin, with management quota reads routed through the same shared cache? It would help to document both the per-environment source requirement and the origin requirement when the fix reaches stable, so users of centralized hubs know what to change.