Skip to content

fix: preserve Antigravity identity on model catalog requests - #3715

Closed
mvanhorn wants to merge 1 commit into
decolua:masterfrom
mvanhorn:fix/3414-preserve-antigravity-catalog-identity
Closed

mvanhorn wants to merge 1 commit into
decolua:masterfrom
mvanhorn:fix/3414-preserve-antigravity-catalog-identity

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Antigravity exposes Gemini 3.7 Flash when connected directly, but the model disappears from its selector when 9router MITM is enabled. Adding the Gemini 3.7 tiers to the dashboard mapping catalog in PR #3382 did not fix the native Antigravity catalog returned through the proxy. The MITM passthrough currently rewrites every Antigravity request to the hardcoded IDE version 1.23.2, including non-chat model-catalog calls from newer Antigravity releases. This gives the issue a concrete local cause consistent with the reporter's reproduction on Antigravity 2.11.0.

Summary

Restrict the legacy Antigravity IDE-version override in src/mitm/antigravityIdeVersion.js to generation endpoints that need the existing upstream compatibility workaround. Pass the request URL from src/mitm/server.js into that decision so model-catalog and other non-chat passthrough requests retain their original User-Agent, metadata, body bytes, and content length. Keep the existing chat-request rewrite behavior intact to avoid reopening the compatibility failure the override was introduced to handle.

Tests

  • A fetchAvailableModels or equivalent non-generation request with an Antigravity 2.11.0 identity is returned unchanged, preserving both the original User-Agent and metadata.ideVersion so current models remain eligible upstream.
  • A generateContent and a streamGenerateContent request still applies the known-good legacy version override and returns the rewritten body for forwarding.
  • A non-chat request with malformed or non-JSON content remains byte-for-byte unchanged and does not acquire a rewritten identity.
  • A request without an Antigravity User-Agent or metadata identity remains unchanged instead of synthesizing identity fields.

Fixes #3414

@decolua

decolua commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn for the contribution! Reviewed and merged into master. 🙏

@decolua decolua closed this Sep 2, 2026
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.

[Bug] Gemini 3.7 Flash missing when Antigravity MITM is enabled

2 participants