Skip to content

Fix Antigravity server side checks and returning Version error#5210

Closed
Ivorisnoob wants to merge 9 commits intoopenclaw:mainfrom
Ivorisnoob:main
Closed

Fix Antigravity server side checks and returning Version error#5210
Ivorisnoob wants to merge 9 commits intoopenclaw:mainfrom
Ivorisnoob:main

Conversation

@Ivorisnoob
Copy link
Copy Markdown

@Ivorisnoob Ivorisnoob commented Jan 31, 2026

image This has been fixed and tested

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:

  • 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.

Confidence Score: 3/5

  • 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

Context used:

  • Context from dashboard - CLAUDE.md (source)
  • Context from dashboard - AGENTS.md (source)

@openclaw-barnacle openclaw-barnacle Bot added extensions: google-antigravity-auth Extension: google-antigravity-auth agents Agent runtime and tooling labels Jan 31, 2026
@Allist
Copy link
Copy Markdown

Allist commented Jan 31, 2026

Could you fix typo in PR title? Antigeravity -> Antigravity

@Ivorisnoob
Copy link
Copy Markdown
Author

Could you fix typo in PR title? Antigeravity -> Antigravity

Surely

@Ivorisnoob Ivorisnoob changed the title Fix Antigeravity server side checks and returning Version error Fix Antigravity server side checks and returning Version error Jan 31, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 42 to 50
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",
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 3, 2026

Additional Comments (2)

src/agents/pi-embedded-runner/extra-params.ts
[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.

Prompt To Fix With AI
This 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.

extensions/google-antigravity-auth/index.ts
[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.

Prompt To Fix With AI
This 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.

@mudrii

This comment was marked as spam.

@mudrii

This comment was marked as spam.

@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 7, 2026
@Ivorisnoob Ivorisnoob closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: google-antigravity-auth Extension: google-antigravity-auth size: XS stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants