fix(antigravity): give the executor and the probe one client identity - #910
Merged
Conversation
Both halves of this provider call CloudCode, and each carried its own User-Agent literal: the request executor advertised antigravity/1.104.0 darwin/arm64 while the account status probe advertised antigravity/1.11.5 windows/amd64. One account therefore looked like two different clients depending on which half was asking. CloudCode gates on that header. The probe, on the older of the two, was served a reduced model set and a coarser quota view than the account actually had — three model families reporting one identical percentage and reset time, because upstream they were a single bucket the older client could not see broken down. Both now derive from antigravity.ClientUserAgent, built from a single ClientVersion. The OAuth identity stays separate on purpose: token and userinfo calls go to Google's OAuth endpoints rather than CloudCode, and google-api-nodejs-client is the correct client for those. Tests pin the properties rather than the strings: the version may not slide below the known floor, the User-Agent must carry it, the OAuth and CloudCode identities must stay distinct, and the executor must resolve to the shared constant so a local literal cannot be reintroduced. reconcile-active-slot.sh gains a note that nginx is deliberately outside its scope, so a green result from it is not read as "the deployment is consistent" — deploy-blue-green.sh is what reconciles against nginx. Not done here: folding this into internal/identityfingerprint. That package is a learning system driven by observed client headers, and it is currently codex-specific. A server-initiated probe has no client request to learn from, so the fit is poor, and #884 is actively reworking those files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Both halves of this provider call CloudCode, and each carried its own User-Agent literal:
antigravity/1.104.0 darwin/arm64antigravity/1.11.5 windows/amd64One account looked like two different clients depending on which half of the system was asking, and both were far behind the real Antigravity release (4.3.0).
CloudCode gates its answer on that header. The probe, on the older of the two, was served a reduced model set and a coarser quota view than the account actually had — which is why three model families reported one identical percentage and one identical reset time down to the second. Upstream they were a single bucket that the older client could not see broken down.
The fix
Both now derive from
antigravity.ClientUserAgent, built from a singleClientVersion.The OAuth identity deliberately stays separate: token and userinfo calls go to Google's OAuth endpoints rather than CloudCode, and
google-api-nodejs-clientis the correct client for those. A test pins that the two must not collapse into one.Tests pin properties, not strings
ClientVersionmay not slide below the known floor (4.3.0)ClientUserAgentmust carry the version, in thevscode/1.X.X (Antigravity/…)form the real client sendsPer-account
user_agentoverrides still win — that path is untouched.What I did not do, and why
Folding this into
internal/identityfingerprint. That package is a learning system: it derives fingerprints from observed client request headers, and it is currently codex-specific (CodexProfileKey,classifyCodexUserAgent,classifyCodexOriginator). A server-initiated probe has no client request to learn from, so the fit is poor. #884 is also actively reworking those exact files, and this change would collide with it.If #884 lands and someone wants antigravity in that system afterwards,
ClientVersionis the single place to move.Verification
go build ./...,go vet ./internal/... ./sdk/...,gofmtall clean; fullgo test ./...green locally.Note this path cannot be verified against production: the host has no antigravity accounts (
ai_account_statusholds only xai, codex and claude), so this rests on the tests plus the fact that the upstream client itself sends this header.🤖 Generated with Claude Code