GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(server): prove Claude usage is re-read on an explicit refresh by Lokkuchakreshkumar · Pull Request #1 · ryoppippi/t3code

Conversation

@Lokkuchakreshkumar

@Lokkuchakreshkumar Lokkuchakreshkumar commented Nov 14, 2026

Copy link
Copy Markdown

Problem

Usage → Limits can show a Claude session bar that does not match claude /usage on the same machine, and the Limits refresh button can leave it there for minutes.

This PR is the CI-runnable proof for pingdotgg#28720. The automated pipeline stopped that pull request because it could not observe the fix: proving it needs a signed-in native Claude provider with first-party Claude OAuth usage, and that provider is unavailable on every CI VM, so the replay provider could not establish Claude-specific usage-cache behavior.

Change

A test that drives the real Claude driver and shows both halves of the cache, plus one comment in ClaudeDriver that names the cache the reading comes from.

How the stale reading happens:

  1. ClaudeDriver keeps a per-instance capabilities cache (apps/server/src/provider/Drivers/ClaudeDriver.ts). A probe that carried usage stays cached for CAPABILITIES_PROBE_TTL — five minutes.
  2. checkProvider resolves capabilities through that cache, so a fresh probe's usage reading is reused for up to five minutes.
  3. ManagedServerProvider.refresh — what the Limits refresh button and server.refreshProviders call — forced a provider check but never dropped that cache entry, so it republished the reading it already had.
  4. fix(server): refreshing providers re-reads Claude usage older than a minute pingdotgg/t3code#28720 makes an explicit refresh invalidate the cache once the published usage reading is at least a minute old. The one-minute floor keeps a refresh from hammering /api/oauth/usage, which is rate-limited per account ([Bug]: Native Claude provider: usage probes hit /api/oauth/usage with no back-off and drop the last good reading (429s) pingdotgg/t3code#27772).

The new test (apps/server/src/provider/ProviderInstanceRegistry.test.ts, "re-reads Claude usage on an explicit refresh once the reading is a minute old") drives the real driver with a probe whose reading the test controls:

step reported reading probe
first refresh 12% one probe
refresh again, inside the floor 12% no new probe — served from the capabilities cache
refresh after a minute 88% a new probe — the reading was re-read

Scope

Test-only, plus a comment. No behaviour, contract or setting changes.

Stacked on pingdotgg#28720 (ryoppippi:fix/explicit-refresh-usage-cache); merge this after it. It supplies the proof that pull request was stopped for, and covers pingdotgg#28721.

Verification

  • vp test run apps/server/src/provider/ProviderInstanceRegistry.test.ts — 28 passed.

  • The new test fails with fix(server): refreshing providers re-reads Claude usage older than a minute pingdotgg/t3code#28720's change to packages/provider-core/src/server/managedProvider.ts reverted to its pre-fix(server): refreshing providers re-reads Claude usage older than a minute pingdotgg/t3code#28720 revision:

    FAIL  src/provider/ProviderInstanceRegistry.test.ts > re-reads Claude usage on an explicit refresh once the reading is a minute old
    AssertionError: expected 12 to be 88
    

    With fix(server): refreshing providers re-reads Claude usage older than a minute pingdotgg/t3code#28720 in place it passes: the last refresh reports the re-read 88%.

  • vp run check:changed — format, lint, knip, graphql, typecheck (27 packages) and the tests beside the change all pass.

  • vp test run packages/provider-core/src/server/managedProvider.test.ts — 21 passed.

No Claude account is involved: the probe is the Claude Agent SDK query mocked in the test, the readings are synthetic (12% and 88%), and the CLI is the repository's existing fake claude fixture. No token, no real account, no real reading. The test skips on Windows, where the fixture's shell script cannot run.

Model: minimax-m3.1-flash-free · Harness: OpenCode

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Lokkuchakreshkumar
test(server): Claude usage is re-read on an explicit refresh
52d5a45
Claude's capabilities probe keeps a usage reading for five minutes, and
ManagedServerProvider.refresh forced a provider check without dropping
that cache entry, so the Usage → Limits tab republished the reading it
already had. pingdotgg#28720 re-reads the reading once it is a minute old.

The test drives the real Claude driver with a synthetic probe reading and
shows both halves: inside the floor the reading comes from the cache, and
past the floor an explicit refresh re-reads Claude. Without pingdotgg#28720's
change to managedProvider the last refresh still reports the stale
reading.
@Lokkuchakreshkumar Lokkuchakreshkumar mentioned this pull request Nov 14, 2026
fix(server): refreshing providers re-reads Claude usage older than a minute pingdotgg/t3code#28720
Open
@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Nov 14, 2026
@Lokkuchakreshkumar Lokkuchakreshkumar mentioned this pull request Nov 14, 2026
[Bug]: Refreshing providers keeps showing Claude usage up to five minutes old pingdotgg/t3code#28721
Open
3 tasks done
@github-actions github-actions Bot added the size:XS label Nov 14, 2026
@Lokkuchakreshkumar

Lokkuchakreshkumar commented Nov 14, 2026

Copy link
Copy Markdown
Author

Superseded by the upstream pull request: pingdotgg#36533 — opening it in pingdotgg/t3code, where the base branch belongs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Lokkuchakreshkumar Lokkuchakreshkumar closed this Nov 14, 2026
@Lokkuchakreshkumar
Lokkuchakreshkumar deleted the test/claude-usage-explicit-refresh branch November 14, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Lokkuchakreshkumar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.