Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Usage → Limits refresh does not refresh Antigravity quotas within 5 minutes (no checkUsageLimits + throttled async probe) #48280

Openalexgunsberg(GitHub profile, opens in a new tab) opened this issue 0 comments

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. Configure an Antigravity (oauth-personal) provider instance and open Usage → Limits (which triggers a usage poll via agy usage --json).
  2. Run a turn on that Antigravity account that consumes quota (e.g. draining the last 1% of Gemini Weekly from 1% down to 0%).
  3. Within 5 minutes of the previous poll, open Usage → Limits or click the Refresh limits button (server.refreshProviders({ limitsOnly: true })).

Expected behavior

An explicit limits refresh (server.refreshProviders({ limitsOnly: true })) should run antigravity usage --json without being blocked by the 5-minute background health-check throttle, await the result, and publish the updated usageLimits without needing a full ACP health check round-trip.

Actual behavior

Clicking Refresh limits within 5 minutes of the last poll leaves stale Antigravity numbers in the UI (for example, showing 1% left when antigravity usage --json reports 0%), and even after 5 minutes it runs an extra ACP health check and returns the stale snapshot first:

  1. makeManagedServerProvider in apps/server/src/provider/AntigravityProvider.ts (lines 470–488) does not pass checkUsageLimits.
  2. When server.refreshProviders({ limitsOnly: true }) invokes ManagedServerProvider.refreshUsage(), the absence of input.checkUsageLimits causes it to fall back to applySnapshotBase(settings, { forceRefresh: true }) → checkProvider().
  3. checkProvider() (line 458) calls refreshUsage(true) (throttled by USAGE_REFRESH_INTERVAL_MS = 5 * 60_000, line 58 & 337–343), which silently returns without probing agy usage --json if < 5 minutes have elapsed.
  4. Even when unthrottled, refreshUsage forks options.probeUsage asynchronously in usageRead and checkProvider() immediately returns the previous usageLimits. When the async probe later updates metadata, publishEnrichedSnapshot preserves the old state.snapshot.usageLimits, so the new quota only appears after republish runs a second full managed.refresh (checkProvider()).

Impact

Minor bug or occasional failure

Version or commit

0.1.14-nightly.20261203.5651 (reproduced on main @ 4b8199987c)

Environment

Linux ARM64 server + macOS Electron desktop (0.1.14-nightly.20261203.5651), Antigravity (oauth-personal)

Logs or stack traces

# AntigravityProvider.ts
# - line 58:  const USAGE_REFRESH_INTERVAL_MS = 5 * 60_000;
# - line 458: if (initialized !== undefined) yield* refreshUsage(true);
# - lines 470-488: makeManagedServerProvider({ ... }) omits checkUsageLimits

Workaround

Wait >5 minutes after the previous usage poll and refresh again.

  1. tanstack-source added labelsbug

Sign in to join this conversation.