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.
Area
apps/server
Steps to reproduce
- Set up three Claude instances (three
claudeAgentinstances, each with its own Claude home and its own Max subscription). Every account has banked resets. - Link two environments that run the same three instances: a Windows server and a macOS server.
- From the Windows client, open Usage → Limits and click refresh several times.
Expected behavior
Each Claude bar keeps showing its own banked-reset count on every refresh. If a read fails, the bar keeps the last known count instead of hiding it.
Actual behavior
The ticket badge jumps between accounts. On one refresh, account C shows 2 and A and B show nothing. On the next refresh, C shows nothing and A shows 3. Each number shown is that account's real count, but usually only one account at a time has a badge. After many refreshes, no account shows a badge. The Weekly and Weekly · Fable bars still load normally.
Real counts, read from GET https://api.anthropic.com/api/oauth/usage?cedar_ember=1&skip_spend=1: A 3, B 2, C 2.
Impact
Major degradation or frequent failure
Version or commit
0.1.8 (server and client), Claude Code 2.1.322
Environment
Windows server and client, plus a linked macOS server. Three Claude Max accounts.
Logs or stack traces
I read the endpoint above once per account, by hand, at the same moment:
account A: HTTP 200
account B: HTTP 200
account C: HTTP 429, Retry-After: 16
A few minutes earlier, after a few refreshes, all three accounts returned 429. The rate limit is per account and short. T3's own polling was enough to keep account C limited.
Grants on account A (event props and percentages removed):
full-reset-2611 resets_left=1 clears=[seven_day, seven_day_overage_included] ends 2026-12-10
launch-2610-fable resets_left=1 clears=[seven_day_overage_included] ends 2027-03-09
launch-2610-fable-6mo resets_left=1 clears=[seven_day_overage_included] ends 2027-03-09
next_grant_id = full-reset-2611
Account B has full-reset-2611 and launch-2610-fable.
Cause
From the 0.1.8 build (apps/server/src/provider/claudeResetCredits.ts and the Claude driver):
- A failed read hides the count.
readClaudeResetCreditsends withEffect.timeout("10 seconds")andEffect.orElseSucceed(() => undefined). A 429 or a timeout becomes "no credits". Each provider check rebuildsusageLimitsthroughapplySnapshotBase, so the earlierresetCreditsis dropped. Theprevious.resetCreditscarry-over inapplyUsageLimitsUpdateonly covers streamed window updates. Credits are also skipped whenever the capability probe's usage read failed (!usageLimits.unavailable). - Each refresh reads every account's usage several times at once. The Usage page refresh calls
refreshUsageRateson every selected environment in parallel.refreshUsageclears the 5-minute capability cache. For each instance,checkProviderthen runs the SDK usage probe, followed right away by the uncachedcedar_emberread. I assume the SDK probe reads the same endpoint (as [Bug]: Native Claude provider: usage probes hit /api/oauth/usage with no back-off and drop the last good reading (429s) #27772 describes). If so, with two environments each account gets about three usage reads within a second per refresh, and thecedar_emberread comes last, so it is the one most likely to get the 429. Which account keeps its badge on a given refresh looks like chance (inferred). - The macOS server never reports credits.
readAccessTokenreturnsundefinedondarwin, because Claude Code keeps the login in the Keychain ([Bug]: Claude banked resets never show when the server runs on macOS #34097, closed as no-repro, but 0.1.8 still behaves this way). The macOS server still runs the SDK usage probe for the same accounts, so it spends their rate-limit budget without adding credits. The client merge (usageLimitsin the web bundle) keeps the newest entry that has credits for each account, so the macOS snapshot does not erase the Windows count. That part works. The cost is the extra requests. - Fable-only grants count toward the all-models Weekly.
Grantdecodes onlyid,resets_left,ends_at,pausedandusable_now.availableCountsums all live grants. Account A shows 3 on Weekly, but only 1 of its grants clearsseven_day. This is [Bug]: Usage → Limits shows a Fable-only Claude reset credit on every Claude window #33509 with another grant mix (Max plan, two Fable grants plus a full reset).
Suggested fixes
- Keep the last known credits through a 429 or timeout, mark them stale, and honor
Retry-After. Open PRs fix(server): Claude reset credits survive failed refreshes #33979 and fix(server): banked Claude resets are read at most every ten minutes per account #19474 cover this. fix(server): banked Claude resets are read at most every ten minutes per account #19474 also shares one read per account across instances. - Read the macOS Keychain login (service
Claude Code-credentials, with a suffix whenCLAUDE_CONFIG_DIRis set), or skip the usage probe for accounts another environment already reports. - Send one usage read per account per refresh across all paths, and do not fan out a manual refresh to every environment when one already reports that account.
- Show scoped (Fable) resets separately, based on each grant's
clears([Bug]: Usage → Limits shows a Fable-only Claude reset credit on every Claude window #33509, fix(usage): Claude reset badges only show on the limits they clear #33553).
Workaround
Refresh Limits at most every few minutes. Once the badges are gone, wait a minute or two and refresh once.
Activity
juliusmarminge commentedon Nov 11, 2026
I tried to reproduce this on the current build and could not.
Commit 52d621a (origin/main). A real Claude Max OAuth login is not available on the VM, so I could not drive Usage → Limits against Anthropic. Instead I added a test to apps/server/src/provider/ProviderInstanceRegistry.test.ts. It runs the real ProviderInstanceRegistry and ClaudeDriver with the repo's fake Claude CLI fixture, a Linux .credentials.json login, and an intercepted HttpClient. First refresh: /api/oauth/usage returns 200 with cedar_ember { eligible, next_grant_id: grant_a, grants: [resets_left 1] }, and the snapshot shows resetCredits.availableCount = 1. Second refresh: the same endpoint returns 429 (Retry-After: 16). The usage windows are unchanged, but resetCredits is undefined. The test fails 3 times out of 3 on the final assertion (expected 1, received undefined). Pushed as factory/repro-34296 (e8f4703). Code path: readClaudeResetCredits ends in Effect.timeout('10 seconds') + Effect.orElseSucceed(() => undefined), and checkClaudeProviderStatus in ClaudeProvider.ts rebuilds usageLimits on every check with no carry-over of the earlier resetCredits.
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.
zakius commentedon Nov 17, 2026
This still happens on 0.1.10-nightly.20261116.4774 in normal use. It needs only one Claude instance and one environment, with no linked servers.
claudeResetCredits.ts,ClaudeDriver.tsandpackages/provider-core/src/server/usageLimits.tsare unchanged onmaintoday.Steps
Evidence
Server trace,
readClaudeResetCredits→GET /api/oauth/usage?cedar_ember=1&skip_spend=1, 18:31–19:39 UTC: 79 reads, 29 × 200, 50 × 429. The reads run on every provider check, at whatever interval the user sets, with no back-off after a 429. The span always exitsSuccess, becauseorElseSucceedturns the 429 intoundefined.Cause
This is point 1 of this issue, which
factory/repro-34296already reproduces. Every provider check rebuildsusageLimits.resolveUsageLimitsAfterProbekeeps the earlier snapshot only when the whole probe fails (probeFailed), not when only thecedar_emberread fails. So each 429 publishes a snapshot with noresetCredits, and every client hides the button until the next 200.The usage bars and the reset credits read the same endpoint through two paths that handle a 429 differently:
probeClaudeCapabilities, which is cached for 5 minutes. When the endpoint returns 429, Claude Code answers from its persistedcachedUsageUtilizationsnapshot ([Bug]: Claude usage limits show cached data as freshly checked when /api/oauth/usage is rate-limited #38070). Live sessions also keep the windows moving throughrate_limit_event. The bars therefore never go empty.cedar_emberread. It has no cache and no fallback, and it does not back off.The result is that usage looks healthy while the reset button flickers.
Expected
resetCredits, marked as stale if needed, instead of dropping them.Retry-Afterinstead of re-reading on every provider check ([Bug]: Native Claude reset-credit read retries /api/oauth/usage every 5 minutes after a 429 and ignores Retry-After, so the account stays rate-limited #37053). Even then, at the default interval a single 429 would hide the button for 5 minutes.As it stands, the reset button is unreliable at exactly the moment the user needs it.
Related: #37053 (no 429 back-off), #38070 (stale usage marked as fresh when the endpoint is rate-limited).
Triaged with Claude Code (Claude Opus 5.5) via T3 Code's triage flow.