Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related: #27772 (CLI probes 429 the endpoint; asks T3 to keep the last good reading). This report is about what happens now that the last good reading is kept: it gets shown as freshly checked, and a second, uncached poller keeps the endpoint rate-limited.
Area
apps/server
Steps to reproduce
- Use the native Claude provider with a Claude subscription login (no CLIProxyAPI hub), on Windows or Linux.
- Get
/api/oauth/usagerate-limited for that login. Either:- set Background activity → provider health refresh interval to 30 s and leave T3 Code running, or
- click refresh on the provider or the usage limits several times in a row.
- Keep using Claude so real usage changes, and watch the usage limits panel.
- Compare
usageLimits.checkedAtin~/.t3/caches/<instanceId>.jsonwithcachedUsageUtilization.fetchedAtMsin that login's.claude.json.
Expected behavior
While the endpoint is rate-limited, T3 keeps showing the last good reading, but with its real age, so it shows as stale once it's old. checkedAt should be when the numbers were fetched, not when T3 last asked for them.
Actual behavior
The numbers stop changing, but checkedAt moves forward on every probe, so the reading never shows as stale. After a manual refresh, an hour-old reading looks freshly confirmed.
Why it's stamped fresh
probeClaudeCapabilities(src/provider/ClaudeProvider.ts) setsusageCheckedAt = nowjust before callingq.usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(), andcheckClaudeProviderStatususes it asusageLimits.checkedAt.- In Claude Code 2.1.326,
get_usagedoesn't fail when/api/oauth/usagereturns 429. The probe process has sent no API request, so it has no rate-limit headers. It falls back to the snapshot it saved in.claude.json(cachedUsageUtilization, which it labelssource: "persisted") and returns that as ordinaryrate_limitswithrate_limits_available: true. The SDK response doesn't say the data is cached or how old it is. If the saved snapshot is recent enough, Claude Code also answers from it without asking the endpoint at all ("Usage read answered from a snapshot Ns old; endpoint not asked"). - Because
usageis present,ClaudeDriver.tscaches the result as a fresh probe for 5 minutes (CAPABILITIES_PROBE_TTL). The next probe gets the same snapshot and stamps it with a newnow. - Anything that judges freshness by
checkedAttreats the result as current. For example, the client prefers the reading with the newestcheckedAt.
Why the endpoint stays rate-limited
On every provider status check, checkClaudeProviderStatus also calls readClaudeResetCredits (src/provider/claudeResetCredits.ts). That's a direct GET /api/oauth/usage?cedar_ember=1&skip_spend=1 with no cache and no back-off, and orElseSucceed swallows the 429. The 5-minute capabilities cache doesn't cover it, so it runs at the full provider health refresh interval. readAccessToken returns undefined on macOS, so this poll only happens on Windows and Linux, which may be why #27772 (macOS) didn't see it.
With a 30 s interval and two Claude logins, the server trace has 388 readClaudeResetCredits spans in 105 minutes, about one call every 30 s per login.
Manual refreshes make it worse. Provider refresh, refreshUsage, model-cache invalidation and fresh workspace scans all call invalidateCaches first. So each click starts a new CLI usage probe and makes another direct reset-credits call. A turn that fails with usage_limit also triggers refreshUsage.
What I observed (10:15 UTC)
| Login | T3 usageLimits.checkedAt |
Claude Code cachedUsageUtilization.fetchedAtMs |
5h / 7d used |
|---|---|---|---|
A (default ~/.claude) |
10:09:49Z | 09:44:34Z | 2% / 36% (identical) |
B (custom homePath) |
10:07:44Z | 09:12:16Z (63 min old) | 0% / 7% (identical) |
Calling GET /api/oauth/usage directly at the same time: login A got 429 twice (retry-after: 0). Login B got one 200, then 429.
Impact
Major degradation or frequent failure
Usage limits look current when they can be an hour old, with nothing on screen to say so. That makes them unreliable for deciding when to switch accounts or start a long task.
Version or commit
T3 Code Nightly 0.1.11-nightly.20261117.4814
Environment
Windows 11, desktop app, Claude Code 2.1.326 (native install), two Claude subscription logins, no hub.
Logs or stack traces
# ~/.t3/caches/claudeAgent.json
"usageLimits": { "checkedAt": "2026-11-17T10:09:49.142Z", "windows": [
{ "id": "five_hour", "usedPercent": 2, "resetsAt": "2026-11-17T13:30:00.488Z" },
{ "id": "seven_day", "usedPercent": 36, "resetsAt": "2026-11-20T21:00:00.488Z" } ] }
# ~/.claude.json (same login)
"cachedUsageUtilization": { "fetchedAtMs": 1794908674467, # 2026-11-17T09:44:34Z
"utilization": { "five_hour": { "utilization": 2, ... }, "seven_day": { "utilization": 36, ... } } }
# GET https://api.anthropic.com/api/oauth/usage (10:12:57Z)
HTTP 429 retry-after: 0
{"error":{"type":"rate_limit_error","message":"Rate limited. Please try again later."}}
# server.trace.ndjson, 08:29Z-10:14Z
readClaudeResetCredits 388 spans (~3.7/min across 2 logins, median 55 ms, every exit "Success")
checkClaudeProviderStatus 589 spansSuggested fix
- Use a real fetch time. Don't stamp CLI
get_usageresults with the probe time. Either usecachedUsageUtilization.fetchedAtMsfrom the login's.claude.jsonwhen its values match the response, or take the usage windows from T3's own direct/api/oauth/usageread, which has a real response time. - One read, not two.
readClaudeResetCreditsalready fetches/api/oauth/usage. A single request could provide both the usage windows and the reset credits, instead of two separate pollers hitting the same per-account limit. - Cache that read and back off. Cache the read and back off on 429. Honour
Retry-After, with a minimum, since the endpoint sends0. Use one throttle for every refresh route: the interval, manual refresh,refreshUsage, workspace scans and model refreshes. This is ask 3 in [Bug]: Native Claude provider: usage probes hit /api/oauth/usage with no back-off and drop the last good reading (429s) #27772. - Keep the old timestamp. While rate-limited, keep the last good reading with its original
checkedAt, so the existing stale and age display works.
Workaround
Set the provider health refresh interval to 5 minutes or more, and avoid repeated manual refreshes. To see how old the numbers really are, check cachedUsageUtilization.fetchedAtMs in the login's .claude.json.
Investigated and drafted with Claude Code from the installed Nightly build.
Activity
VDrozd-Cyclis commentedon Nov 18, 2026
I reproduced the missing reset credits on T3 Code 0.1.10, using the macOS desktop client connected to a Linux x64 server with Claude Code 2.1.326. The provider health interval was 60 seconds.
Claude Settings → Usage showed two reset credits, one Weekly and one Fable. T3 Usage → Limits showed the matching usage bars (43% weekly remaining and 80% Fable remaining) with no reset badge.
On November 18, the Linux server trace recorded eight consecutive HTTP 429 responses from the reset-credit lookup between 08:29 and 08:35 CET. The provider snapshot at 08:33 CET contained both usage windows and omitted
resetCredits. This confirms that the separate reset-credit request can be rate-limited on Linux while the usage bars still render.edwardEsmerson commentedon Nov 20, 2026
Reproduced the intermittent missing Claude reset credits on T3 Code Desktop
0.1.11-nightly.20261119.4928(local server, Linux x64, Claude Code2.1.323) with two nativeclaudeAgentPro accounts using separate config directories.Evidence
Over ~1 hour of
server.trace.ndjson, T3 made 35 calls toGET https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1:Example sequence across three refreshes (with
capabilitiesProbeCachealready warm on the 2nd and 3rd):T+0s: refresh → both instances returned429onreadClaudeResetCredits(exit: SuccessviaEffect.orElseSucceed(() => undefined)).T+4s: cache-hit refresh →readClaudeResetCreditsstill fired uncached for both instances; one got200(reset credits appeared) and one got429.T+41s: cache-hit refresh → both got429, which overwrote the snapshot withoutresetCreditsand hid the reset credits again while the usage bars stayed populated.(Note: another local tool on this machine also periodically calls CLI
get_usage, which increases/api/oauth/usagerate-limit pressure, making T3's uncachedreadClaudeResetCreditscalls and lack of 429 carry-over hit almost continuously.)Relevant code on
e8c4824bapps/server/src/provider/Drivers/ClaudeDriver.ts:readClaudeResetCreditsruns outsidecapabilitiesProbeCachewith no cache orRetry-Afterbackoff, firing both immediately afterprobeClaudeCapabilities(get_usage) and on every cache-hit refresh.apps/server/src/provider/claudeResetCredits.ts&packages/provider-core/src/server/usageLimits.ts:Effect.orElseSucceed(() => undefined)collapses 429 into "no credits", andresolveUsageLimitsAfterProbereplaces the previous snapshot wheneverprobed.unavailableis unset, dropping previously knownresetCredits.Same underlying issue as #34296, #37053, and open PR #33979.