feat(gateway): recognise Antigravity CLI requests as antigravity-cli - #207
Merged
Merged
Conversation
Antigravity CLI (agy) has no user agent of its own. Pointed at a custom
Gemini endpoint (GOOGLE_GEMINI_BASE_URL + GEMINI_API_KEY with
modelProvider "gemini"), agy 1.2.11 sends the Go genai SDK default in
both User-Agent and X-Goog-Api-Client:
google-genai-sdk/1.71.0 gl-go/go1.28-20260721-RC03 cl/951519500 +3ebc191975 X:fieldtrack,...
Matching on `google-genai-sdk` alone would label every Go program built
on the SDK as agy. What sets agy apart is the Google-internal Go
toolchain version after `gl-go/` (it carries `cl/<number>`); a program
built with a public Go release sends `gl-go/go1.25.1`. The hint now maps
that combination to `antigravity-cli`, the client id ThinkWatch Lite
uses for it.
Captured by running agy against a local fake server with a fake key and
all outbound traffic blocked; no account was signed in.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012JfMJSMbfEW5nzkn9vro9A
Merged
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.
Requested by F · project thread
What this changes
Requests from Antigravity CLI (
agy) now getclient_hint = "antigravity-cli", the client id ThinkWatch Lite uses for it (ThinkWatch-Lite#213). Before, they got no hint, so Lite's "in use" indicator could never light up for agy.Why
agy has no user agent of its own. Pointed at a custom Gemini endpoint, it sends the Go genai SDK default in both
User-AgentandX-Goog-Api-Client:Matching
google-genai-sdkalone would label every Go program built on the SDK as agy, andhint.rsalready prefers no guess to a wrong one. What sets agy apart is the Google-internal Go toolchain version aftergl-go/(it carriescl/<number>); a program built with a public Go release sendsgl-go/go1.25.1. The hint matches all three:google-genai-sdk/prefix,gl-go/,cl/.How it was verified
storage.googleapis.com/antigravity-public(the URL in Homebrew'santigravity-clicask; sha256 matches the cask). Ranagy -p "say pong"with an isolatedHOME,settings.json={"modelProvider":"gemini"},GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:18999,GEMINI_API_KEY=<fake>, auto-update off and every proxy variable pointed at a dead port. No account was signed in. A local fake server logged two requests (gemini-3.1-flash-lite-previewfor the title,gemini-3.1-pro-previewfor the turn), both with the header above; nothing else distinguishing was sent (X-Goog-Api-Key,Content-Type,Accept-Encodingonly).antigravity_cli_is_recognised_by_the_toolchain_in_its_user_agentuses the captured string verbatim, and asserts a public-toolchain Go SDK UA staysNone. All 7hinttests pass.cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings(rustc 1.98.1),cargo test --workspace: clean../scripts/smoke.sh: 60 passed, 0 failed.CONTROL_API_VERSIONis unchanged.Notes for review
Nonerather than guessing.antigravity-cli.🤖 Generated with Claude Code
https://claude.ai/code/session_012JfMJSMbfEW5nzkn9vro9A
Generated by Claude Code