Skip to content

[Bug]: Refreshing providers keeps showing Claude usage up to five minutes old #28721

Open

Description

@ryoppippi

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. Start T3 Code with a signed-in Claude provider and wait for the initial Claude check.
  2. Refresh providers (the Usage page refresh, the provider settings refresh button, or server.refreshProviders with an empty payload).
  3. Refresh again a minute or two later, still within five minutes of the initial check.
  4. Compare Claude's usageLimits.checkedAt after each refresh.

Expected behavior

An explicit refresh returns a freshly read Claude usage reading, as it does for the other providers.

Actual behavior

Claude's usageLimits.checkedAt stays at the initial check for up to five minutes, so every refresh in that window shows the same reading while Codex, Grok and the others come back freshly probed.

ClaudeDriver caches capabilities with fresh usage for CAPABILITIES_PROBE_TTL (five minutes). ManagedServerProvider.refresh forces a provider check but never calls invalidateUsageCache, so the check reads the cached probe. Only refreshUsage (after a turn) and the reset redemption invalidate it.

Impact

Minor bug or occasional failure

Version or commit

T3 Code (Beta) 0.1.3; reproduced on main at 1d626d0.

Environment

macOS, Claude Pro account, native Claude provider.

Logs or stack traces

Two refreshes against a dev server on main (vp run dev:server --no-seed):

refresh started 15:58:43 -> Claude usageLimits.checkedAt 15:58:40.443Z (startup check)
refresh started 15:59:06 -> Claude usageLimits.checkedAt 15:58:40.443Z

Workaround

None from the UI; waiting five minutes before refreshing.

Related

#27772 reports that Claude's /api/oauth/usage is rate-limited per account and asks for one throttle across refresh routes. A fix here should therefore not let explicit refreshes read the endpoint without a bound. Proposed fix: #28720, which re-reads usage on an explicit refresh only when the published reading is at least a minute old.

Activity

  1. Lokkuchakreshkumar commented on Nov 14, 2026

    @Lokkuchakreshkumar

    The fix for this is in #28720. The CI-runnable proof for it, stacked on that branch, is here: ryoppippi#1

    The proof drives the real Claude driver with a mocked Claude Agent SDK query and the repository's fake claude fixture, so it needs no signed-in Claude account: a refresh inside the one-minute floor is answered from the capabilities cache, and a refresh past the floor re-reads Claude. Reverting #28720's change to packages/provider-core/src/server/managedProvider.ts makes the new test fail with AssertionError: expected 12 to be 88.

    The proof is one commit (52d5a4581) and can be cherry-picked onto #28720's branch.

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