Claude usage limits never populate: rate_limit_event numbers live under unifiedWindows, and get_usage returns rate_limits: null #30310
What happens#
Every Claude provider instance reports
usageLimits: { windows: [], unavailable: { reason: "probeFailed" } } in
server.getConfig, and checkedAt never moves after real turns. Codex
instances on the same server report their session and weekly windows fine.
Seen on T3 0.1.6 and on v0.1.7-nightly.20261103.4119 (both code paths are
identical), with Claude Code 2.1.306 on a Pro subscription, macOS arm64.
Cause#
Two separate paths in apps/server/src/provider/claudeUsageLimits.ts:
Per-turn
rate_limit_eventis dropped.claudeRateLimitEventToUpdatereturns early unlessinfo.utilizationis a number:if (!type || typeof info.utilization !== "number") { return; }Claude Code 2.1.306 sends no top-level
utilization. The numbers are inunifiedWindows, as 0..1 fractions:{ "type": "rate_limit_event", "rate_limit_info": { "status": "allowed", "resetsAt": 1793736600, "rateLimitType": "five_hour", "overageStatus": "rejected", "overageDisabledReason": "org_level_disabled", "isUsingOverage": false, "unifiedWindows": { "five_hour": { "utilization": 0.49, "resetsAt": 1793736600 }, "seven_day": { "utilization": 0.11, "resetsAt": 1793768400 } } } }So every event maps to
undefinedandonUsageLimitsis never called.The
get_usageprobe getsrate_limits: null. The capability probe sends theget_usagecontrol request; the CLI answersrate_limits_available: truewithrate_limits: null, whichclaudeUsageResponseToLimitsturns intoprobeFailed.
Suggested fix#
In claudeRateLimitEventToUpdate, when info.unifiedWindows is present, map
each known key (five_hour, seven_day, and the model-scoped ones) with
utilization * 100 and its own resetsAt, and keep the existing flat
utilization path for older CLIs. That alone makes the windows appear after the
first turn, even while the get_usage probe still returns null.
Repro#
- Register a Claude provider instance logged in with a subscription.
- Run one turn.
server.getConfig→providers[instance].usageLimitsis stillprobeFailedwith no windows, while the provider event log for the thread contains therate_limit_eventabove.
Follow-up: fix in #31135, tested in a real environment with the org-managed flag. With #30999 applied as well, Usage → Limits shows Session and Weekly, and both survive a manual refresh (a failed probe). Without #31135, the released app has the Weekly window in its cache, but the UI hides it.
Note: #31135 changes behavior from #15116, which made a failed probe drop streamed windows. The PR keeps the
probeFailedmarker but keeps and shows the windows, because for these accounts a full probe never succeeds. The trade-off is explained in the PR. It needs a maintainer call.Confirming this still reproduces on the latest nightly, with a newer Claude Code than the report.
Setup#
- T3 Code
0.1.8-nightly.20261107.4327(also seen on0.1.5-nightly.20261029.3867), Linux x64, background service - Claude Code 2.1.319 (also seen on 2.1.314), Pro subscription, claude.ai OAuth
- Claude shows no limits in T3. Antigravity limits do appear.
Findings#
rate_limit_eventis still dropped.claudeRateLimitEventToUpdatein 0.1.8 is unchanged and returns early unlessinfo.utilizationis a top-level number. Events from 2.1.319 carry the numbers only underunifiedWindows:{"status":"allowed","resetsAt":1794091200,"rateLimitType":"five_hour","overageStatus":"rejected","overageDisabledReason":"org_level_disabled","isUsingOverage":false,"unifiedWindows":{"five_hour":{"utilization":0.05,"resetsAt":1794091200,"status":"allowed"},"seven_day":{"utilization":0,"resetsAt":1794139200,"status":"allowed"}}}get_usagestill returnsrate_limits: null. I ran the capability probe directly with@anthropic-ai/claude-agent-sdkagainst the 2.1.319 binary, with and withoutCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, polling for ~10s. Every response wasrate_limits_available: true, rate_limits: null, so the flag is not the cause on this setup.- The data is available to the account.
GET /api/oauth/usagewith the same token returns session 2% and weekly 0%, and T3's own status checks (checkClaudeProviderStatus) succeed with no auth errors.
So a user with a plain Pro login and no managed settings hits both paths. This matches the first fix proposed in the issue (map
unifiedWindowsin the event handler). #30999 was closed unmerged, so as far as I can tell nothing onmainhandles that case yet.- T3 Code
tanstack-source added labelsbug
I tried to reproduce this on the current build and could not.
Commit origin/main 6de770c1e6. A real app run was not possible: Claude usage limits need a first-party Claude subscription login, which no worker VM has. Instead, I added a test to apps/server/src/provider/claudeUsageLimits.test.ts that passes the reporter's rate_limit_event (status allowed, rateLimitType five_hour, no top-level utilization, unifiedWindows five_hour 0.49 and seven_day 0.11) to claudeRateLimitEventToUpdate. On main the function returns undefined instead of the Session 49% and Weekly 11% windows. The test fails 1 of 9; the other 8 pass. In the code, the early return
if (!type || typeof info.utilization !== "number") return undefined;never reads unifiedWindows.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
juliusmarminge closed this
Thanks for looking into this! I think the test you describe actually reproduces it: on main,
claudeRateLimitEventToUpdatereturnsundefinedfor that event, and that is the bug users see.As far as I can tell, the CLI only sends the flat top-level
utilizationonce a usage-warning threshold is passed. Below it, the values are only inunifiedWindows, so T3 shows no Claude limits. I can confirm this on Claude Code 2.1.319 at 3% session / 41% weekly usage. The early return atclaudeUsageLimits.ts:160is still unchanged in v0.1.9.#28869 maps
unifiedWindowsand should fix this. Would you mind reopening the issue, or tracking it there?Still reproduces on current builds — adding fresh evidence.
Environment: Linux x64 (CachyOS), T3 Code desktop AppImage
0.1.12-nightly.20261120.5009→0.1.12-nightly.20261122.5098, Claude Code2.1.330(native subscription OAuth).What I see: the Usage page shows only the Codex row; there is no
claudeAgentrow at all (not an error message — the row is absent). The composer context meter is unrelated.Evidence from the provider event logs:
- 933
rate_limit_eventmessages; 663 carry their percentages only inrate_limit_info.unifiedWindows[window].utilizationwith no top-levelutilization. - The 270 events that do have the flat field are all warning-threshold crossings (e.g.
five_hour0.99 on Nov 21 19:10 andseven_day0.99 on Nov 22 14:33). Current below-threshold values (five_hour≈ 0.30,seven_day≈ 0.04) arrive only underunifiedWindows. - So
claudeRateLimitEventToUpdatereturnsundefined, no windows reachapplyUsageLimits, the snapshot has nousageLimits, and the Usage page filters the Claude provider out.
Upstream status: on
mainat593885bd,apps/server/src/provider/claudeUsageLimits.ts:167still hasif (!type || typeof info.utilization !== "number") return undefined;with nounifiedWindowshandling. PRs #28869 and #31135 are both still open, so updating does not fix it.This matches the original report and juliusmarminge's reproducing test. Please reopen this or track it in #28869. I can supply redacted sample events if useful.
Triage note: produced with the
t3 triageplaybook (the Codex agent needed a TTY, so the playbook was followed manually); analysis by OpenCode, hy4-flash-free.- 933
Sign in to join this conversation.
Another data point, with a cause that PR #30999 alone will likely not fix.
Setup#
@anthropic-ai/claude-agent-sdk0.3.284CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1comes from the org's remote managed settings (~/.claude/remote-settings.json), not from the user's own settings or env. The user can't override it (any non-empty value counts as set, see #27492).Why the probe returns
rate_limits: nullhere#With that flag set,
get_usageanswers in about 7 ms withrate_limits_available: true, rate_limits: null. The CLI debug log showsfetchUtilization: GET /api/oauth/usage (attempt 1), then nothing. A direct authenticated GET to/api/oauth/usagereturns 200 with full data. So for org-managed accounts the probe will never succeed, not just "before the first turn". The per-turnrate_limit_eventis the only source, because it comes from inference response headers, which count as essential traffic.The events are already parsed, but the window still doesn't show#
On this CLI the events still have the flat fields, so the current code already maps them:
The provider cache (
~/.t3/caches/claudeAgent.json) then holds:The Limits view still shows Claude as unavailable. Two gaps remain:
applyUsageLimitsUpdatekeepsprevious.unavailable(probeFailed) after merging streamed windows. It looks like the UI treatsunavailableas "no data" and hides the windows it has. I haven't traced the renderer, so this is inferred from the stored state plus what the UI shows.rateLimitTypewindow is taken.five_hourinunifiedWindowsis ignored. #30999 addresses this part.Suggestion#
probeFailed, for example with a "from last request" hint instead of the error. Or clearunavailablewhen a stream update lands.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, say that limits update after the next turn, instead of "Could not read limits".