Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(antigravity): read plan usage limits over ACP #45176

Draftpatrick-toulme(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/45176/headopened View on GitHub

Problem

#43026 removed direct HTTP reads of Antigravity usage limits so T3 Code does not read saved Google credentials or call Google APIs directly, noting that limits could return once agy acp exposes them over ACP (google-antigravity/antigravity-cli#1968).

Change

  • Detect agentCapabilities._meta.antigravity.quota === true on ACP initialize, and preserve capabilities._meta when normalizing v2 initialize responses in effect-acp.
  • Call _antigravity/quota ({ refresh?: boolean }) over ACP and map returned groups and buckets into ServerProviderUsageLimits across 5-hour session and weekly windows for both personal Google account (oauth-personal) and Gemini Enterprise (oauth-business) sign-ins. Non-subscription sign-in methods (gemini-api-key, agent-platform) report unsupported without spawning a probe.
  • Refresh limits on sign-in, refreshModels, session start, every 60 seconds during active prompts, after each turn, and on refreshUsage (reusing an active ACP session when one is open, or running a sessionless initialize and _antigravity/quota call without creating conversation files).
  • Retain previously published limits on transient failures, clear limits and cancel pending reads across sign-out, account switch, runtime downgrade, or ACP -32000 (auth_required), and cache runtimes that do not advertise _meta.antigravity.quota so current agy releases remain no-ops without repeated spawns.
  • Scope exhaustedUsageWindow to the matching Antigravity model pool (including dedicated subfamily buckets and shared Claude and GPT pools) and order Antigravity windows consistently in displayLimitWindows.
  • Update docs/user/providers-antigravity.md.

Current agy releases do not advertise agentCapabilities._meta.antigravity.quota yet, so behavior is unchanged until the corresponding agy acp release ships.

Scope

Keeping in draft while _antigravity/quota ships in agy acp (google-antigravity/antigravity-cli#1968), following #43026.

Verification

  • vp test run apps/server/src/provider/acp/AntigravityQuota.test.ts: checked capability detection, 5-hour and weekly window mapping, untouched full-window reset suppression, explicit zero and sub-1% remaining fractions, disabled and non-fractional buckets, supported: false, and ACP -32000, -32601, and timeout handling.
  • vp test run apps/server/src/provider/AntigravityProvider.test.ts apps/server/src/provider/Drivers/AntigravityDriver.test.ts: checked that runtimes without _meta.antigravity.quota never receive _antigravity/quota and are not respawned on repeated refreshUsage calls, sessionless refreshUsage publishes windows without calling session/new, live sessions refresh at start and after turns and share their open runtime with refreshUsage, transient probe errors keep existing limits, sign-out and account switches and ACP -32000 cancel pending reads and clear limits, and API key sign-in reports unsupported.
  • vp test run packages/shared/src/usageLimits.test.ts apps/server/src/provider/ProviderRegistry.test.ts packages/effect-acp/src/client.test.ts: checked per-family and dedicated subfamily exhaustion checks, window display ordering, provider registry retention, and ACP client initialization.
  • Verified AntigravityDriver end to end against an agy acp build supporting _antigravity/quota across signed-out -32000, personal Google OAuth, Gemini Enterprise, refreshModels, offline failure retention, revoked-token -32000, and API key sign-in, confirming sessionless refreshUsage creates no conversation files on disk.
  • vp run check:changed: format, lint, knip, graphql, typecheck across all 39 packages, and tests pass.
    1. tanstack-source added labelsfeature

Sign in to join this conversation.