#5210: Fix Antigravity server side checks and returning Version error
extensions: google-antigravity-auth
agents
size: XS
Cluster:
Security Enhancements and Fixes
<img width="831" height="258" alt="image" src="https://github.com/user-attachments/assets/1897a8ca-f319-43d1-92ee-20ca00863f7e" />
This has been fixed and tested
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the Google Antigravity integration to satisfy server-side client/version checks by changing the request metadata sent to Antigravity endpoints. Concretely:
- The Antigravity OAuth extension now sends a new `Client-Metadata` payload when calling `loadCodeAssist` to discover the user’s project.
- The Pi embedded runner injects Antigravity-specific headers (`User-Agent`, `X-Goog-Api-Client`, `Client-Metadata`) via the stream wrapper so model calls present the expected client identity.
- The Antigravity usage fetcher (`provider-usage.fetch.antigravity.ts`) updates its `metadata` payload for `loadCodeAssist` to the same new format.
Overall, this fits into the codebase’s provider plumbing by aligning the auth/usage/model-call surfaces to send consistent identifying headers/metadata to Google Antigravity APIs.
<h3>Confidence Score: 3/5</h3>
- This PR is likely safe to merge, but there is one behavioral risk around header merging that can undermine the intended fix.
- Changes are localized and straightforward, but the new Antigravity header patch can be overwritten by caller-provided headers due to merge order, which could reintroduce the version-check failure. The remaining issues are maintainability concerns (duplicated hard-coded metadata).
- src/agents/pi-embedded-runner/extra-params.ts
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#5064: fix(auth): update deprecated User-Agent headers
by mfortin014 · 2026-01-31
86.6%
#4445: fix: resolve Antigravity "unsupported version" and tool_use schema ...
by harry2690 · 2026-01-30
84.5%
#2535: fix(google-antigravity): use 127.0.0.1 instead of localhost for OAu...
by brian033 · 2026-01-27
78.8%
#16684: fix:(antigravity): align Antigravity OAuth project discovery header...
by vincentkoc · 2026-02-15
77.7%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
77.3%
#16687: fix(antigravity): default to Gemini 3 Pro and remove broken depreca...
by vincentkoc · 2026-02-15
77.0%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
76.6%
#15205: fix(models): normalize google-antigravity api field from google-gem...
by wboudy · 2026-02-13
75.8%
#15379: fix(antigravity): strip unsigned thinking blocks in agent loop via ...
by jg-noncelogic · 2026-02-13
75.2%
#13361: fix(google-antigravity): add Opus 4.6 support and fix thinking.sign...
by SovranAMR · 2026-02-10
74.4%