Fix Antigravity server side checks and returning Version error#5210
Fix Antigravity server side checks and returning Version error#5210Ivorisnoob wants to merge 9 commits intoopenclaw:mainfrom
Conversation
|
Could you fix typo in PR title? |
Surely |
| const METADATA = { | ||
| ideType: "ANTIGRAVITY", | ||
| platform: "PLATFORM_UNSPECIFIED", | ||
| pluginType: "GEMINI", | ||
| ide: "antigravity", | ||
| ideVersion: "1.15.8", | ||
| appName: "codeium-extension", | ||
| devMode: "false", | ||
| extensionVersion: "", | ||
| language: "UNSPECIFIED", | ||
| os: "windows", | ||
| }; |
There was a problem hiding this comment.
[P1] Antigravity metadata is duplicated + hard-coded.
This file defines a METADATA object with the same hard-coded ideVersion/os values also used in other Antigravity call sites (e.g. auth extension and stream header patch). If these values need updating, it’s easy for one place to drift and cause inconsistent behavior across endpoints. Consider centralizing the Antigravity client metadata (or at least exporting a shared constant) so all requests use identical metadata.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/infra/provider-usage.fetch.antigravity.ts
Line: 42:50
Comment:
[P1] Antigravity metadata is duplicated + hard-coded.
This file defines a `METADATA` object with the same hard-coded `ideVersion`/`os` values also used in other Antigravity call sites (e.g. auth extension and stream header patch). If these values need updating, it’s easy for one place to drift and cause inconsistent behavior across endpoints. Consider centralizing the Antigravity client metadata (or at least exporting a shared constant) so all requests use identical metadata.
How can I resolve this? If you propose a fix, please make it concise.
Additional Comments (2)
In Prompt To Fix With AIThis is a comment left during a code review.
Path: src/agents/pi-embedded-runner/extra-params.ts
Line: 92:97
Comment:
[P0] `options?.headers` currently overrides the Antigravity version/metadata patch.
In `wrappedStreamFn`, you build `headers` as `{ ...streamParams.headers, ...options?.headers }`. Since `options` are provided by callers, any existing `options.headers` (even empty defaults) will overwrite the `User-Agent`/`Client-Metadata` you set for `provider === "google-antigravity"`, which can reintroduce the exact server-side version check failure this PR is trying to fix. Consider reversing the merge order for Antigravity (or only force-set the specific header keys after the merge) so the required headers can’t be clobbered by caller defaults.
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: extensions/google-antigravity-auth/index.ts
Line: 247:261
Comment:
[P1] Metadata/version headers are hard-coded and OS-specific.
`fetchProjectId` sends `Client-Metadata` with `ideVersion: "1.15.8"` and `os: "windows"` unconditionally. If the upstream service changes expected versions again, or if their checks validate OS/UA consistency, this can break for non-Windows clients and force another code change. Consider deriving `os` from `process.platform` (and keeping the version in a single shared constant) so Antigravity calls stay consistent across platforms and are easier to update in one place.
How can I resolve this? If you propose a fix, please make it concise. |
bfc1ccb to
f92900f
Compare
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
This pull request has been automatically marked as stale due to inactivity. |
Greptile Overview
Greptile Summary
This PR updates the Google Antigravity integration to satisfy server-side client/version checks by changing the request metadata sent to Antigravity endpoints. Concretely:
Client-Metadatapayload when callingloadCodeAssistto discover the user’s project.User-Agent,X-Goog-Api-Client,Client-Metadata) via the stream wrapper so model calls present the expected client identity.provider-usage.fetch.antigravity.ts) updates itsmetadatapayload forloadCodeAssistto 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.
Confidence Score: 3/5
Context used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)