Skip to content

fix(antigravity): give the executor and the probe one client identity - #910

Merged
kittors merged 1 commit into
devfrom
fix/antigravity-client-version
Aug 19, 2026
Merged

fix(antigravity): give the executor and the probe one client identity#910
kittors merged 1 commit into
devfrom
fix/antigravity-client-version

Conversation

@kittors

@kittors kittors commented Aug 19, 2026

Copy link
Copy Markdown
Owner

The problem

Both halves of this provider call CloudCode, and each carried its own User-Agent literal:

caller advertised
request executor antigravity/1.104.0 darwin/arm64
account status probe antigravity/1.11.5 windows/amd64

One 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 single ClientVersion.

The OAuth identity deliberately stays separate: token and userinfo calls go to Google's OAuth endpoints rather than CloudCode, and google-api-nodejs-client is the correct client for those. A test pins that the two must not collapse into one.

Tests pin properties, not strings

  • ClientVersion may not slide below the known floor (4.3.0)
  • ClientUserAgent must carry the version, in the vscode/1.X.X (Antigravity/…) form the real client sends
  • OAuth and CloudCode identities must stay distinct
  • The executor must resolve to the shared constant, so a local literal cannot be reintroduced

Per-account user_agent overrides 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, ClientVersion is the single place to move.

Verification

go build ./..., go vet ./internal/... ./sdk/..., gofmt all clean; full go test ./... green locally.

Note this path cannot be verified against production: the host has no antigravity accounts (ai_account_status holds 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

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>
@kittors
kittors merged commit 501b1fd into dev Aug 19, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant