Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

docs: correct Antigravity IDE setup instructions (no third-party model providers) (#4258)

AP4c7acba59371
diff --git a/docs/content/docs/proxy.mdx b/docs/content/docs/proxy.mdx
index 78955de6e..0044e113d 100644
--- a/docs/content/docs/proxy.mdx
+++ b/docs/content/docs/proxy.mdx
@@ -528,16 +528,21 @@ headroom wrap antigravity # Start proxy + print Antigravity setup instr
headroom mcp install --agent antigravity # Register the Headroom MCP server in Antigravity
```
-`wrap antigravity` prints a custom OpenAI-compatible model-provider base URL
-to add in Antigravity's model-provider settings; Antigravity fetches the model
-list from `GET /v1/models` on its own. Native Cloud Code Assist traffic
-(`google-antigravity` clients) is accepted on
-[`POST /v1internal:streamGenerateContent`](#post-v1internalstreamgeneratecontent)
-and routed upstream like any other Cloud Code request.
-
-MCP registration writes to Antigravity's global `mcp_config.json` under
-`~/.gemini/` (preferring the install's current location when one already
-exists) and refuses to overwrite a config file that does not parse as JSON.
+The Antigravity IDE does not support third-party model providers — its
+agent models are Google-managed, so there is no settings panel to point
+at the proxy. What the proxy does offer Antigravity users:
+
+- MCP tools: `mcp install` writes the Headroom server into Antigravity's
+ global `mcp_config.json` under `~/.gemini/` (preferring the install's
+ current location when one already exists) and refuses to overwrite a
+ config file that does not parse as JSON.
+- Native traffic: `google-antigravity` clients are accepted on
+ [`POST /v1internal:streamGenerateContent`](#post-v1internalstreamgeneratecontent)
+ and routed upstream like any other Cloud Code request.
+
+The Antigravity CLI (`agy`), unlike the IDE, accepts a custom endpoint
+via its `GOOGLE_GEMINI_BASE_URL` setting — the one Antigravity surface
+where a custom model endpoint is supported.
### `POST /v1/compress`
diff --git a/headroom/cli/wrap.py b/headroom/cli/wrap.py
index f43d5aafa..c51c3f4f6 100644
--- a/headroom/cli/wrap.py
+++ b/headroom/cli/wrap.py
@@ -7905,21 +7905,19 @@ def antigravity(
verbose: bool,
prepare_only: bool,
) -> None:
- """Start Headroom proxy for use with Antigravity IDE.
+ """Start Headroom proxy for use with the Antigravity IDE.
\b
- Antigravity reads its model endpoints from its model-provider settings,
- not from environment variables. This command starts the proxy and prints
- the settings to add as a custom OpenAI-compatible model provider.
-
- \b
- After running this command, open Antigravity and add a custom model
- provider with the printed base URL. Antigravity fetches the model list
- from GET /v1/models automatically.
+ The Antigravity IDE does not support third-party model providers —
+ its agent models are Google-managed. This command starts the proxy
+ and prints what the integration actually covers: MCP server
+ registration (`headroom mcp install --agent antigravity`) and the
+ native `POST /v1internal:streamGenerateContent` endpoint for
+ `google-antigravity` clients.
\b
Example:
- headroom wrap antigravity # Start proxy + Antigravity settings
+ headroom wrap antigravity # Start proxy + Antigravity setup
headroom wrap antigravity --port 9999 # Custom proxy port
"""
if prepare_only:
diff --git a/headroom/providers/antigravity/runtime.py b/headroom/providers/antigravity/runtime.py
index ccc19bd8b..24a8058f9 100644
--- a/headroom/providers/antigravity/runtime.py
+++ b/headroom/providers/antigravity/runtime.py
@@ -22,9 +22,9 @@ def build_proxy_targets(port: int, project: str | None = None) -> AntigravityPro
"""Build the local proxy URLs shown to Antigravity users.
``project`` (the wrap launch directory) is encoded as a ``/p/<name>``
- base-URL prefix because Antigravity's custom model-provider settings
- cannot send custom headers; the proxy strips it and attributes savings
- per project.
+ base-URL prefix because clients pointing at these URLs cannot be
+ counted on to send custom headers; the proxy strips it and attributes
+ savings per project.
"""
return AntigravityProxyTargets(
openai_base_url=with_project_prefix(codex_proxy_base_url(port), project),
@@ -35,17 +35,32 @@ def build_proxy_targets(port: int, project: str | None = None) -> AntigravityPro
def render_setup_lines(port: int, project: str | None = None) -> list[str]:
"""Render the Antigravity setup instructions for the local proxy."""
targets = build_proxy_targets(port, project)
+ # The Gemini-compatible base URL (scheme://host; Gemini clients append
+ # /v1beta/...) — the one agy expects for GOOGLE_GEMINI_BASE_URL.
+ gemini_base_url = with_project_prefix(f"http://127.0.0.1:{port}", project)
lines = [
- " Headroom proxy is running. Configure Antigravity:",
+ " Headroom proxy is running. Antigravity setup:",
"",
- " Antigravity reads model endpoints from its model-provider settings,",
- " not from environment variables. Add a custom OpenAI-compatible",
- " model provider pointing at the proxy:",
+ " The Antigravity IDE does not support third-party model providers —",
+ " its agent models are Google-managed, so there is no settings panel",
+ " to point at the proxy. What the proxy does offer Antigravity users:",
+ "",
+ " - MCP tools: `headroom mcp install --agent antigravity` registers",
+ " the Headroom MCP server in Antigravity's global mcp_config.json.",
+ " - Native traffic: the proxy accepts `google-antigravity` client",
+ " traffic on POST /v1internal:streamGenerateContent, routed",
+ " upstream like any other Cloud Code request.",
+ "",
+ " The Antigravity CLI (agy), unlike the IDE, accepts a custom",
+ " endpoint via its GOOGLE_GEMINI_BASE_URL setting — point it at",
+ " the proxy's Gemini-compatible base URL:",
+ "",
+ f" GOOGLE_GEMINI_BASE_URL={gemini_base_url}",
+ "",
+ " For OpenAI-speaking clients, the proxy's OpenAI-compatible",
+ " base URL is:",
"",
f" Base URL: {targets.openai_base_url}",
" API Key: your-openai-api-key",
- "",
- " Antigravity fetches the model list from GET /v1/models automatically,",
- " so there is nothing else to register.",
]
return lines + project_attribution_lines(project)
diff --git a/tests/test_cli/test_wrap_antigravity.py b/tests/test_cli/test_wrap_antigravity.py
index 955f551d0..16ccadb74 100644
--- a/tests/test_cli/test_wrap_antigravity.py
+++ b/tests/test_cli/test_wrap_antigravity.py
@@ -17,11 +17,12 @@ def test_wrap_help_lists_antigravity() -> None:
assert "antigravity" in result.output
-def test_wrap_antigravity_help_mentions_custom_model_provider() -> None:
+def test_wrap_antigravity_help_says_ide_has_no_third_party_providers() -> None:
result = CliRunner().invoke(main, ["wrap", "antigravity", "--help"])
assert result.exit_code == 0, result.output
assert "Antigravity" in result.output
- assert "OpenAI-compatible" in result.output
+ assert "does not support third-party model providers" in result.output
+ assert "custom OpenAI-compatible model provider" not in result.output
def test_wrap_antigravity_prepare_only_exits_cleanly() -> None:
diff --git a/tests/test_provider_antigravity.py b/tests/test_provider_antigravity.py
index 8b1833050..2c437e110 100644
--- a/tests/test_provider_antigravity.py
+++ b/tests/test_provider_antigravity.py
@@ -56,10 +56,16 @@ def test_antigravity_render_setup_lines_contains_proxy_url() -> None:
assert "Antigravity" in joined
-def test_antigravity_render_setup_lines_mentions_custom_provider() -> None:
+def test_antigravity_setup_lines_do_not_claim_ide_provider_settings() -> None:
joined = "\n".join(render_setup_lines(8787))
- assert "OpenAI-compatible" in joined
- assert "/v1/models" in joined
+ assert "does not support third-party model providers" in joined
+ assert "Add a custom OpenAI-compatible" not in joined
+ assert "model-provider settings" not in joined
+ assert "mcp install --agent antigravity" in joined
+ assert "/v1internal:streamGenerateContent" in joined
+ assert "GOOGLE_GEMINI_BASE_URL" in joined
+ assert "GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:8787" in joined
+ assert "For OpenAI-speaking clients" in joined
def test_antigravity_render_setup_lines_project_attribution() -> None: