Skip to content

[Bug]: Claude reset badges jump between accounts on refresh, then vanish, with several Claude instances #34296

Closed as not planned

Description

@InvixGG

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

  1. Set up three Claude instances (three claudeAgent instances, each with its own Claude home and its own Max subscription). Every account has banked resets.
  2. Link two environments that run the same three instances: a Windows server and a macOS server.
  3. 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):

  1. A failed read hides the count. readClaudeResetCredits ends with Effect.timeout("10 seconds") and Effect.orElseSucceed(() => undefined). A 429 or a timeout becomes "no credits". Each provider check rebuilds usageLimits through applySnapshotBase, so the earlier resetCredits is dropped. The previous.resetCredits carry-over in applyUsageLimitsUpdate only covers streamed window updates. Credits are also skipped whenever the capability probe's usage read failed (!usageLimits.unavailable).
  2. Each refresh reads every account's usage several times at once. The Usage page refresh calls refreshUsageRates on every selected environment in parallel. refreshUsage clears the 5-minute capability cache. For each instance, checkProvider then runs the SDK usage probe, followed right away by the uncached cedar_ember read. 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 the cedar_ember read 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).
  3. The macOS server never reports credits. readAccessToken returns undefined on darwin, 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 (usageLimits in 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.
  4. Fable-only grants count toward the all-models Weekly. Grant decodes only id, resets_left, ends_at, paused and usable_now. availableCount sums all live grants. Account A shows 3 on Weekly, but only 1 of its grants clears seven_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

Workaround

Refresh Limits at most every few minutes. Once the badges are gone, wait a minute or two and refresh once.

Activity

  1. juliusmarminge commented on Nov 11, 2026

    @juliusmarminge
    Member

    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.

  2. zakius commented on Nov 17, 2026

    @zakius

    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.ts and packages/provider-core/src/server/usageLimits.ts are unchanged on main today.

    Steps

    1. Run a T3 Code server on Linux with one native Claude instance (Claude Code 2.1.326), on a subscription with a banked reset (here, one Fable reset).
    2. Set Settings → Background activity → provider health refresh interval to 60 s. The 5-minute default should trigger it too, just less often ([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).
    3. Watch "Use reset" in Usage → Limits from any client. I saw it in the web, desktop and Android apps, all connected to this server.
    4. The button appears and disappears from one minute to the next. Once it went away just as I was about to tap it on Android. The usage bars keep updating normally while the reset button is gone.

    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 exits Success, because orElseSucceed turns the 429 into undefined.

    19:35:24Z 429
    19:36:16Z 200   <- button shown
    19:36:25Z 429   <- button gone (when I tried to tap it)
    19:36:39Z 429
    19:37:24Z 429
    19:37:25Z 429
    19:38:25Z 200   <- shown again (cached snapshot: availableCount 1)
    19:39:25Z 429
    

    Cause

    This is point 1 of this issue, which factory/repro-34296 already reproduces. Every provider check rebuilds usageLimits. resolveUsageLimitsAfterProbe keeps the earlier snapshot only when the whole probe fails (probeFailed), not when only the cedar_ember read fails. So each 429 publishes a snapshot with no resetCredits, 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:

    • Usage windows come from the Claude SDK usage call in probeClaudeCapabilities, which is cached for 5 minutes. When the endpoint returns 429, Claude Code answers from its persisted cachedUsageUtilization snapshot ([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 through rate_limit_event. The bars therefore never go empty.
    • Reset credits come from T3's own direct cedar_ember read. 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

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions