Thread details card shows Limits "Unavailable" for a proxied Claude instance even with a CLIProxyAPI hub connected#27208

opened9d agobyKkaedendev

What happened

On a Claude thread routed through CLIProxyAPI, the Usage section of the thread details card shows Limits: Unavailable, even after a CLIProxyAPI hub is connected and Usage → Limits shows the pooled Claude accounts.

Diagnosis

  • The Claude instance reaches the hub through ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Its provider snapshot is auth.type: "apiKey" with usageLimits.unavailable.reason: "unsupported", as documented in docs/user/usage.md.
  • A hub was added under Settings → Providers → Usage providers. CliproxyApi.readAccounts succeeds and the hub's accounts appear under Usage → Limits, labelled "CLI Proxy".
  • ThreadDetailsUsage (apps/web/src/components/chat/ThreadDetailsUsage.tsx:54-58) only uses the report entry whose instanceId matches the thread's instance, then falls back to the instance's own usageLimits. In collectProviderUsageLimits (packages/shared/src/usageLimits.ts:829-850), hub accounts are pushed without an instanceId, and a proxied instance has no email or account key to match them by. So the card always gets the "unsupported" snapshot, and limitsNotice turns it into "Unavailable".
  • This is a missing feature, not a regression. When the selected instance has no usable limits of its own and its requests go to a connected hub's endpoint (or there is exactly one connected hub with accounts for that driver), the card could show the hub's pooled windows, the same numbers /usage-limits and Usage → Limits already show.

Steps to reproduce

  1. Run CLIProxyAPI with at least one Claude subscription account.
  2. Point Claude Code at it with ANTHROPIC_BASE_URL=<hub> and ANTHROPIC_AUTH_TOKEN=<key>.
  3. In T3 Code, add the hub under Settings → Providers → Usage providers → Add hub, with its URL and management key.
  4. Turn on Usage in Settings → Appearance → Thread details.
  5. Open a Claude thread. Usage → Limits shows the pooled Claude accounts, but the thread details card shows "Limits: Unavailable".

Version

0.1.5 (T3 Code Desktop and server). Checked against 0.1.6-nightly.20261029.3892 and main too: ThreadDetailsUsage.tsx and the matching logic have not changed.

Environment

macOS 26.7 arm64, Node 24.22.1, claude CLI 2.1.312, self-hosted CLIProxyAPI over Tailscale HTTPS.

Evidence

shell
1# cached Claude provider snapshot (trimmed)
2"auth": { "status": "authenticated", "type": "apiKey", "label": "Claude API Key" }
3"usageLimits": { "windows": [], "unavailable": { "reason": "unsupported" } }
4
5# server trace after connecting the hub (trimmed)
622:37:55 CliproxyApi.readAccount Success
722:37:55 CliproxyApi.credits Success
822:37:55 CliproxyApi.readAccounts Success

#26909 reports the same card symptom but tracks the "Claude API Key" label for a proxy set in Claude's settings.json (fix #26937). It mentions #26938 as the proposal for this feature, but #26938 returns 404, so nothing tracks it. #19520 covers Usage view rows for Codex behind a shared CLIProxyAPI gateway.

Fix applied or workaround

Connected the hub in Settings. Usage → Limits and /usage-limits show the pooled numbers; the thread details card still does not.

Filed by

Claude Code (claude-opus-5-5) via t3 triage in T3 Code

This conversation has been locked.