fix(server): stop reading Antigravity usage limits from Google's internal APIs #43026
main fromrefs/pull/43026/head·merged by juliusmarminge View on GitHubAntigravity 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.tsand its tests. That file held the quota probe, the OAuth refresh, the keyring/Windows credential reads and the fakeantigravity/hubuser agent. I also removed its wiring fromAntigravityProviderandAntigravityDriver: the usage fiber, the republish deferred andonSignedIn. - 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 serverUsageLimitSources, since nothing produces those windows anymore. - Dropped
@napi-rs/keyringfrom 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.tspackages/shared:usageLimits.test.tsapps/web:ThreadDetailsUsage.logic.test.tsvp run typecheck(server) andvp 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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
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.jsoncThe 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.mdThe 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 testsUsage-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 toab78a· assessed changes only-
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks:
4-
Check name Status Explanation Title check 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 Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Description check 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/keyringfrom 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-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/remove-antigravity-usage-limits
- File: .coderabbit.config.ts
- Commit: ab78a78
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
8d2030b3-1044-4a81-b6de-d80ae7e8cb09
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.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 17-
apps/server/package.jsonapps/server/src/provider/AntigravityProvider.test.tsapps/server/src/provider/AntigravityProvider.tsapps/server/src/provider/Drivers/AntigravityDriver.test.tsapps/server/src/provider/Drivers/AntigravityDriver.tsapps/server/src/provider/antigravityUsageLimits.test.tsapps/server/src/provider/antigravityUsageLimits.tsapps/server/src/testUtils/shardWeights.jsonapps/server/src/usage/UsageLimitSources.test.tsapps/server/src/usage/UsageLimitSources.tsapps/server/src/usage/cliproxyApi.test.tsapps/server/src/usage/cliproxyApi.tsapps/web/src/components/chat/ThreadDetailsUsage.logic.tsdocs/user/usage.mdknip.jsoncpackages/shared/src/usageLimits.test.tspackages/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 merged this96423cb
juliusmarminge closed this
Cross-referencing a relevant comment regarding this: https://github.com/pingdotgg/t3code/issues/40015#issuecomment-7174686543
can we use
agy -p "/usage" --output-format jsoninstead 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.Ok, so will this functionality be restored through a public API?
+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 20scommand (minimumagy >= 1.1.11version gate to avoid spending turns,AGY_CLI_DISABLE_AUTO_UPDATE=true, and reference tostablyai/orca's CLI-based probe): https://github.com/pingdotgg/t3code/discussions/43343Hopefully delegating to the official
agybinary (without T3 Code touching internal Google APIs or OS keyring tokens) can be considered as a safe interim option until ACP exposes quotas directly.I can't stand not being able to see my credit limit and hope it can be fixed as soon as possible.
+1 to
agy -p /usagechecks, 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.Sharing another clean path that has been working well for us in domios.dev — might be useful here too alongside the
agy -p /usageidea.Instead of reading OAuth tokens from the keyring or touching
cloudcode-pa.googleapis.comat all (zero direct network requests to Google), we delegate 100% to the officialagybinary via its documentedstatusLinecommand 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,
agyitself 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
statusLineconfig pointing at an ephemeral127.0.0.1listener, capture the first structured payloadagyemits, and tear down the process immediately. - On the host side, we treat it as an abstract
statusline-quotacapability reader (any CLI/ACP runtime supportingstatusLineplugs into the same parser, failing closed on malformed payloads).
Might be a nice zero-internal-API interim approach until ACP exposes quota natively.
- During active sessions,
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Other scenarios#
All 64 scenario measurements match
main.All 64 scenario measurements
short turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsshort turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsBaseline:
dc5ae5c· PR result:ab78a78· Source CI: successScenario 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.