Skip to content

fix(server): stop reading Antigravity usage limits from Google's internal APIs - #43026

Merged
juliusmarminge merged 1 commit into
mainfrom
t3/remove-antigravity-usage-limits
Nov 25, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
t3/remove-antigravity-usage-limits

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Antigravity supports only ACP for external clients. Google told us that calling its internal APIs can get an account flagged. T3 Code was reading Antigravity quotas from cloudcode-pa.googleapis.com (retrieveUserQuotaSummary / fetchAvailableModels) in two places: the local provider probe and the CLIProxyAPI hub reader. Either one could get users in trouble.

What changed

  • Deleted antigravityUsageLimits.ts and its tests. That file held the quota probe, the OAuth refresh, the keyring/Windows credential reads and the fake antigravity/hub user agent. I also removed its wiring from AntigravityProvider and AntigravityDriver: the usage fiber, the republish deferred and onSignedIn.
  • The hub no longer reads Antigravity accounts. They're skipped like any other unsupported provider, and a regression assertion covers that.
  • Removed the Antigravity-only window handling in @t3tools/shared/usageLimits, the web thread details and server UsageLimitSources, since nothing produces those windows anymore.
  • Dropped @napi-rs/keyring from the server manifest. Only this probe used it; desktop still depends on it for browser cookie import.
  • Updated docs/user/usage.md.

Local Antigravity token history (read from on-disk conversation databases, no network) is unchanged. Limits can come back once Antigravity exposes them over ACP; their team said they'd pass the request along.

Verification
Nothing here is visual: Antigravity now shows no limits, the same as other providers that don't report any. These pass:

  • apps/server: cliproxyApi.test.ts (including the new assertion that hub Antigravity accounts are never called), UsageLimitSources.test.ts, AntigravityProvider.test.ts, AntigravityDriver.test.ts
  • packages/shared: usageLimits.test.ts
  • apps/web: ThreadDetailsUsage.logic.test.ts
  • vp run typecheck (server) and vp run check:changed (format, lint, knip)

v1internal no longer appears anywhere outside .repos. The only remaining cloudcode-pa mention is in AntigravityTurnOutcome.ts, which parses the rate-limit errors that the ACP runtime itself reports; it makes no requests.

🤖 Generated with Claude Code

…rnal APIs

Antigravity only supports ACP for external clients, and Google confirmed that
calling its internal APIs can flag a user's account. T3 Code read Antigravity
quotas from cloudcode-pa.googleapis.com (locally and through CLIProxyAPI hubs),
so remove the quota probe, the hub reader, and the Antigravity-only window
handling that interpreted those quotas. Local token history is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: dc5ae5c · PR result: ab78a78 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change removes Antigravity usage-limit probing and CLIProxyAPI hub reads. It also removes Antigravity-specific usage-window matching and sorting. The documented hub providers are Codex, Claude, and Grok.

Changes: Antigravity usage-limit removal

Layer / File(s) Summary
Remove Antigravity usage probing
apps/server/src/provider/antigravityUsageLimits.ts, apps/server/src/provider/AntigravityProvider.ts, apps/server/src/provider/Drivers/AntigravityDriver.ts, related tests, apps/server/package.json, knip.jsonc
The Antigravity usage probe and its provider and driver integration are removed. The keyring dependency, probe tests, and shard-weight entry are also removed.
Stop reading Antigravity hub accounts
apps/server/src/usage/cliproxyApi.ts, apps/server/src/usage/cliproxyApi.test.ts, docs/user/usage.md
The CLIProxyAPI hub no longer registers Antigravity as a supported provider. The tests and documentation reflect that Antigravity accounts are not read.
Remove Antigravity-specific window handling
packages/shared/src/usageLimits.ts, apps/server/src/usage/UsageLimitSources.ts, apps/web/src/components/chat/ThreadDetailsUsage.logic.ts, related tests
Usage-window selection and display no longer use Antigravity-specific model matching or sorting. Reset selection and thread usage routing no longer apply an additional Antigravity window filter.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

Suggested reviewers: bil0000

Merge Risk: Minimal · up to ab78a · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the server stops reading Antigravity usage limits from Google's internal APIs. The changeset deletes the quota probe, its credential and OAuth code, and the hub reader…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description fills every section of the repository template. Problem: Google told the team that calling Antigravity's internal APIs (cloudcode-pa.googleapis.com) can flag an account, and the local …
Full details: Title check

Explanation

The title names the main change: the server stops reading Antigravity usage limits from Google's internal APIs. The changeset deletes the quota probe, its credential and OAuth code, and the hub reader for those APIs, so the title matches the change. It follows the conventional commit format and is 78 characters long.

Full details: Description check

Explanation

The description fills every section of the repository template. Problem: Google told the team that calling Antigravity's internal APIs (cloudcode-pa.googleapis.com) can flag an account, and the local probe and CLIProxyAPI hub reader both made those calls. Change: the PR deletes antigravityUsageLimits.ts and its tests, removes the related wiring in AntigravityProvider and AntigravityDriver, excludes Antigravity accounts from the hub, removes Antigravity-only window handling in shared, web, and server code, drops @napi-rs/keyring from the server manifest, and updates docs/user/usage.md. Scope: it is a bug-style fix that removes unsafe network calls, and it links no issue. Verification: it lists the focused test files and the typecheck and check commands that pass, and it states the expected visible result (Antigravity shows no limits). Gaps: the Scope section does not link an issue or a maintainer request, and it does not explain why no issue is needed. The title is not part of the description but the commit message is conventional. The template asks for the model and harness that did the work; the author used Claude Code, but the description names no model version. The description also does not say whether this is a draft.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between dc5ae5c and ab78a78.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 17

  • apps/server/package.json
  • apps/server/src/provider/AntigravityProvider.test.ts
  • apps/server/src/provider/AntigravityProvider.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.test.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.ts
  • apps/server/src/provider/antigravityUsageLimits.test.ts
  • apps/server/src/provider/antigravityUsageLimits.ts
  • apps/server/src/testUtils/shardWeights.json
  • apps/server/src/usage/UsageLimitSources.test.ts
  • apps/server/src/usage/UsageLimitSources.ts
  • apps/server/src/usage/cliproxyApi.test.ts
  • apps/server/src/usage/cliproxyApi.ts
  • apps/web/src/components/chat/ThreadDetailsUsage.logic.ts
  • docs/user/usage.md
  • knip.jsonc
  • packages/shared/src/usageLimits.test.ts
  • packages/shared/src/usageLimits.ts
Files with no reviewable changes: 11

  • apps/server/package.json
  • apps/server/src/provider/AntigravityProvider.test.ts
  • apps/server/src/provider/AntigravityProvider.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.test.ts
  • apps/server/src/provider/antigravityUsageLimits.test.ts
  • apps/server/src/provider/antigravityUsageLimits.ts
  • apps/server/src/testUtils/shardWeights.json
  • apps/server/src/usage/UsageLimitSources.test.ts
  • knip.jsonc
  • packages/shared/src/usageLimits.test.ts
  • packages/shared/src/usageLimits.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge
juliusmarminge merged commit 96423cb into main Nov 25, 2026
40 checks passed
@juliusmarminge
juliusmarminge deleted the t3/remove-antigravity-usage-limits branch November 25, 2026 19:25
This was referenced Nov 25, 2026
danielphan2003 added a commit to danielphan2003/skid-panel that referenced this pull request Nov 25, 2026
Google told T3 Code that calling its internal Cloud Code APIs can get an
account flagged, and Antigravity exposes no quota API to external clients
(pingdotgg/t3code#43026). Drop the Antigravity quota tab and the auth-file
quota section, and make its adapter never select a file, so the dashboard
stops calling retrieveUserQuotaSummary and loadCodeAssist. The rendering
code stays for when ACP reports limits.
fcakyon added a commit to fcakyon/t3code that referenced this pull request Nov 25, 2026
Resolve conflicts across AntigravityAdapterV2, AntigravityDriver, agentContextBudget, ProviderSetupSection, and deleted antigravityUsageLimits files (pingdotgg#43026, pingdotgg#42931, pingdotgg#42517, pingdotgg#42671).

verification: 24 focused test suites passed, vp run i18n:check passed, vp run check:changed origin/nightly passed format, lint, knip, graphql, typecheck (43/43), and react compiler, unused patches verified with VP_HOME
@DarthBenro008

Copy link
Copy Markdown

Cross-referencing a relevant comment regarding this: #40015 (comment)

can we use agy -p "/usage" --output-format json instead of calling Google's Internal APIs directly? A direct removal of antigravity usage is a bummer giving how popular Neon has become and that T3 code is one of the only harness that allows to use Antigravity models without ban risk.

gabrielelpidio added a commit that referenced this pull request Nov 25, 2026
On agy 1.5.0, or when T3 cannot read the runtime version, the ACP handshake
sent clientInfo name "zed" so agy would offer models it allowlists for Zed.
Posing as another client breaks the same rule as #43026: use Antigravity only
as itself, over ACP. Always send t3-code.

The Antigravity provider page also still told users to open Usage > Limits for
their Google allowances, which #43026 removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
EvoIos added a commit to EvoIos/t3code that referenced this pull request Nov 28, 2026
Upstream PR pingdotgg#43026 removed direct calls to Google internal APIs for Antigravity usage limits.

Restore usage limit reporting by invoking the official `agy -p /usage --output-format json` CLI command with the instance profile environment, 5-minute TTL caching, in-flight deduplication, and epoch-0 reset_time filtering.

Implemented with Gemini 4 Neon via Antigravity harness.
EvoIos added a commit to EvoIos/t3code that referenced this pull request Nov 28, 2026
Upstream PR pingdotgg#43026 removed direct calls to Google internal APIs for Antigravity usage limits.

Restore usage limit reporting by invoking the official `agy -p /usage --output-format json` CLI command with the instance profile environment, 5-minute TTL caching, in-flight deduplication, and epoch-0 reset_time filtering.

Implemented with Gemini 4 Neon via Antigravity harness.
github-actions Bot pushed a commit to crvouga/homelab that referenced this pull request Nov 28, 2026
#423)

Pin the manager and workers to the T3 release containing
pingdotgg/t3code#43026. Upstream removed the native and hub probes that
requested private quota APIs and produced repeated Google sign-in
prompts. Retire the homelab diagnostic that required quota windows and
document the supported behavior.

Verified release ancestry, the Linux x64 artifact digest and absence of
both reported messages. `bun run check` passes.
tarunravi added a commit to tarunravi/t3code that referenced this pull request Nov 28, 2026
This reverts commit 96423cb (pingdotgg#43026). Antigravity and Gemini usage
limits keep showing, both for local instances and for Antigravity
accounts pooled through a CLIProxyAPI hub.

Adapted to later upstream changes: the Antigravity driver keeps the
incompatible-runtime import added since, the hub tests read the
{ accounts, unreadProviders } result, the unread-provider test uses an
unknown provider instead of antigravity, and the hub doc line lists
Antigravity again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Subin-Gurung49 added a commit to Subin-Gurung49/t3code that referenced this pull request Nov 28, 2026
Keeps the fork's Antigravity quota cards by restoring the code upstream removed in 96423cb (pingdotgg#43026), now guarded in scripts/fork-divergences.json.
@rollacode

Copy link
Copy Markdown

Sharing another clean path that has been working well for us in domios.dev — might be useful here too alongside the agy -p /usage idea.

Instead of reading OAuth tokens from the keyring or touching cloudcode-pa.googleapis.com at all (zero direct network requests to Google), we delegate 100% to the official agy binary via its documented statusLine command hook:

{
  "statusLine": {
    "type": "command",
    "enabled": true,
    "command": "curl -s --max-time 2 -X POST --data-binary @- http://127.0.0.1:<ephemeral-port>/<token>"
  }
}

How it behaves in practice:

  • During active sessions, agy itself pushes its structured statusLine JSON (including quota windows / reset times) to our local loopback receiver after turns — no extra polling, no token/keyring access, no custom User-Agent, no internal API calls.
  • On manual refresh / cold start, we run a bounded one-shot probe with a temporary statusLine config pointing at an ephemeral 127.0.0.1 listener, capture the first structured payload agy emits, and tear down the process immediately.
  • On the host side, we treat it as an abstract statusline-quota capability reader (any CLI/ACP runtime supporting statusLine plugs into the same parser, failing closed on malformed payloads).

Might be a nice zero-internal-API interim approach until ACP exposes quota natively.

@tazerl814-eng

Copy link
Copy Markdown

Can we add this back with new ToS chages? @juliusmarminge

@juliusmarminge

Copy link
Copy Markdown
Member Author

Can we add this back with new ToS chages? @juliusmarminge

Don't think so, this is still an internal endpoint and afaict nothing changed about that. Reached back out to google contacts to confirm though

@markblundeberg

Copy link
Copy Markdown

@markblundeberg

Copy link
Copy Markdown

@juliusmarminge ^

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

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants