Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/43026/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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

    1. tanstack-source added labelsbug

    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.5 KiB21.5 KiB0 B (0.0%)24.4 KiB✅
      CodexLive turn messages110 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Other scenarios

      All 64 scenario measurements match main.

      All 64 scenario measurements
      ProviderScenarioMetricMain baselineThis PRImpactPR ceiling
      Codexshort turn resumeWebSocket decoded10.5 KiB10.5 KiB0 B (0.0%)12.7 KiB✅
      Codexshort turn resumeWebSocket messages220 (0.0%)2✅
      Codexlong turn running, cold openHTTP decoded281.7 KiB281.7 KiB0 B (0.0%)302.7 KiB✅
      Codexlong turn running, cold openrows75750 (0.0%)75✅
      Codexlong turn running, history pageHTTP decoded92.4 KiB92.4 KiB0 B (0.0%)107.4 KiB✅
      Codexlong turn running, history pagerows75750 (0.0%)75✅
      Codexlong turn finished, cold openHTTP decoded381.5 KiB381.5 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, socket cold openWebSocket decoded381.6 KiB381.6 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Codexlong turn finished, socket cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, work pageHTTP decoded186.2 KiB186.2 KiB0 B (0.0%)200.2 KiB✅
      Codexlong turn finished, work pagerows1501500 (0.0%)150✅
      Codexidle thread resumeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexidle thread resumeWebSocket messages110 (0.0%)1✅
      Codexfleet shell snapshotHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexfleet shell snapshotrows27270 (0.0%)27✅
      Codexfleet shell subscribeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexfleet shell subscribeWebSocket messages110 (0.0%)1✅
      Codexfleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Codexfleet shell resume checkrows0000✅
      Codexstale shell reloadHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexstale shell reloadrows27270 (0.0%)27✅
      Codexstale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Codexstale shell resumeWebSocket messages220 (0.0%)2✅
      Codexstale todo list cold openHTTP decoded72.4 KiB72.4 KiB0 B (0.0%)83.0 KiB✅
      Codexstale todo list cold openrows75750 (0.0%)75✅
      Codexstale todo list cold opennodes220 (0.0%)4✅
      Codexstale todo list cold opensubagents220 (0.0%)4✅
      Codexstale todo list cold openplans110 (0.0%)2✅
      Codexstale todo list cold openproviderTurns110 (0.0%)2✅
      Codexstale todo list cold opencheckpoints110 (0.0%)2✅
      Claudeshort turn resumeWebSocket decoded10.6 KiB10.6 KiB0 B (0.0%)12.7 KiB✅
      Claudeshort turn resumeWebSocket messages220 (0.0%)2✅
      Claudelong turn running, cold openHTTP decoded283.3 KiB283.3 KiB0 B (0.0%)302.7 KiB✅
      Claudelong turn running, cold openrows75750 (0.0%)75✅
      Claudelong turn running, history pageHTTP decoded93.4 KiB93.4 KiB0 B (0.0%)107.4 KiB✅
      Claudelong turn running, history pagerows75750 (0.0%)75✅
      Claudelong turn finished, cold openHTTP decoded384.2 KiB384.2 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, socket cold openWebSocket decoded384.3 KiB384.3 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Claudelong turn finished, socket cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, work pageHTTP decoded188.1 KiB188.1 KiB0 B (0.0%)200.2 KiB✅
      Claudelong turn finished, work pagerows1501500 (0.0%)150✅
      Claudeidle thread resumeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudeidle thread resumeWebSocket messages110 (0.0%)1✅
      Claudefleet shell snapshotHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudefleet shell snapshotrows27270 (0.0%)27✅
      Claudefleet shell subscribeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudefleet shell subscribeWebSocket messages110 (0.0%)1✅
      Claudefleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Claudefleet shell resume checkrows0000✅
      Claudestale shell reloadHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudestale shell reloadrows27270 (0.0%)27✅
      Claudestale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Claudestale shell resumeWebSocket messages220 (0.0%)2✅
      Claudestale todo list cold openHTTP decoded73.4 KiB73.4 KiB0 B (0.0%)83.0 KiB✅
      Claudestale todo list cold openrows75750 (0.0%)75✅
      Claudestale todo list cold opennodes220 (0.0%)4✅
      Claudestale todo list cold opensubagents220 (0.0%)4✅
      Claudestale todo list cold openplans110 (0.0%)2✅
      Claudestale todo list cold openproviderTurns110 (0.0%)2✅
      Claudestale todo list cold opencheckpoints110 (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.

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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

      • pingdotgg/t3code#40193: The PR removes the quota probe that the issue identifies as returning 403 responses.
      • pingdotgg/t3code#40101: The PR removes the Antigravity usage-window logic and the module that produced the quota rows described in the issue.
      • pingdotgg/t3code#34381: The PR removes the probe that reads Antigravity credential files for usage.
      • pingdotgg/t3code#40678: The PR removes the Antigravity hub reader, so Antigravity accounts are no longer read there.

      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 nameStatusExplanation
      Title checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe 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 dc5ae5ce632b47ece3faee01b46bd226911bd2e6 and ab78a780195ff18b0db5b47297a0db9f0b718deb.

      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.

    4. juliusmarminge merged this96423cb

    5. juliusmarminge closed this

    6. Cross-referencing a relevant comment regarding this: https://github.com/pingdotgg/t3code/issues/40015#issuecomment-7174686543

      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.

    7. Ok, so will this functionality be restored through a public API?

    8. If Google publishes one, yes

    9. +1 to @DarthBenro008's suggestion.

      I opened an Ideas discussion with details and guardrails for probing quotas via the official agy -p /usage --output-format json --print-timeout 20s command (minimum agy >= 1.1.11 version gate to avoid spending turns, AGY_CLI_DISABLE_AUTO_UPDATE=true, and reference to stablyai/orca's CLI-based probe): https://github.com/pingdotgg/t3code/discussions/43343

      Hopefully delegating to the official agy binary (without T3 Code touching internal Google APIs or OS keyring tokens) can be considered as a safe interim option until ACP exposes quotas directly.

    10. I can't stand not being able to see my credit limit and hope it can be fixed as soon as possible.

    11. +1 to agy -p /usage checks, but longterm I also suggest scheduled terminal runs for custom checks under 'scheduled tasks' -- currently we have scheduled 'prompts' but not commands, which would be helpful in pre-scheduled technical checks that aren't reliant on LLM token-consuming prompts.

    12. 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.

Sign in to join this conversation.