Add Antigravity CLI auxiliary provider - #5
Conversation
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-import |
1 |
First entries
tests/agent/test_google_antigravity_cli_adapter.py:3: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
✅ Fixed issues: none
Unchanged: 4740 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ddf8baf7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.chat = _AntigravityChat(self) | ||
|
|
||
| def complete(self, prompt: str) -> str: | ||
| cmd = [self.command, *self.args, "-p", prompt, "--print-timeout", self.print_timeout] |
There was a problem hiding this comment.
Stop passing full prompt in CLI argv
Build the Antigravity request without embedding prompt directly in the command arguments. In complete(), cmd includes -p followed by the full prompt text, which makes auxiliary task content (often conversation/context-compression text that may include secrets) visible via process inspection (ps//proc/<pid>/cmdline) while the subprocess runs. This introduces a real data-exposure path on shared hosts and CI runners; pass prompt content through stdin or another non-argv channel instead.
Useful? React with 👍 / 👎.
| ProviderEntry("huggingface", "Hugging Face", "Hugging Face Inference Providers (20+ open models)"), | ||
| ProviderEntry("gemini", "Google AI Studio", "Google AI Studio (Gemini models — native Gemini API)"), | ||
| ProviderEntry("google-gemini-cli", "Google Gemini (OAuth)", "Google Gemini via OAuth + Code Assist (free tier supported; no API key needed)"), | ||
| ProviderEntry("google-antigravity-cli", "Google Antigravity CLI", "Google Antigravity via local `agy -p` process (text-only; no API key)"), |
There was a problem hiding this comment.
Gate provider from model picker until runtime supports it
Do not expose google-antigravity-cli as a general selectable provider in the model picker until the main runtime resolver handles it. This entry makes users able to set model.provider: google-antigravity-cli, but hermes_cli/runtime_provider.py only has an external-process branch for copilot-acp and otherwise falls through to OpenRouter resolution, so main chat sessions will be routed to the wrong backend (often with model antigravity-cli, which then fails). Either add a runtime-provider branch for this provider or keep it auxiliary-only and hidden from canonical provider selection.
Useful? React with 👍 / 👎.
| self.chat = _AntigravityChat(self) | ||
|
|
||
| def complete(self, prompt: str) -> str: | ||
| cmd = [self.command, *self.args, "-p", prompt, "--print-timeout", self.print_timeout] |
There was a problem hiding this comment.
Avoid argv length failures for large compression prompts
Do not pass the entire synthesized prompt as a single CLI argument. build_prompt_from_messages() can produce very large payloads for auxiliary compression/title tasks, and placing that text directly after -p risks hitting OS command-line length limits (E2BIG/CreateProcess limits), causing deterministic failures on long sessions instead of graceful model fallback. Send prompt text via stdin or a temp file to keep argument size bounded.
Useful? React with 👍 / 👎.
| def create(self, **kwargs: Any) -> Any: | ||
| messages = kwargs.get("messages") or [] | ||
| model = str(kwargs.get("model") or self._client.model or DEFAULT_ANTIGRAVITY_MODEL) |
There was a problem hiding this comment.
Honor per-request timeout in Antigravity adapter
Propagate the request timeout from chat.completions.create(**kwargs) into CLI execution. This adapter reads messages and model but ignores kwargs["timeout"], so auxiliary task timeouts configured in Hermes are not enforced for this provider and calls can run far longer than the task budget (defaulting to the client’s fixed print timeout behavior instead of per-call limits). This can block compression and other auxiliary flows unexpectedly.
Useful? React with 👍 / 👎.
…eSessionPage (NousResearch#43487) When auto-compression rotates the session tip (old #4 → new #5), the incoming page carries the new tip but the previous list still holds the old one. The old tip's id differs from the new tip's id, so the existing id-only dedup in mergeSessionPage() preserves both as separate sidebar rows. Add lineage-level dedup: build a set of incoming lineage keys (`_lineage_root_id ?? id`) and filter survivors whose lineage key matches any incoming row. This mirrors the existing sessionPinId() logic used for pin stability. Fixes NousResearch#43483
Adds a text-only google-antigravity-cli provider backed by local agy -p for Hermes auxiliary tasks, so compression can use Gary's Gemini-aligned Antigravity route without Nous model quota.\n\nVerification:\n- .venv/bin/python -m py_compile agent/google_antigravity_cli_adapter.py agent/auxiliary_client.py hermes_cli/auth.py hermes_cli/models.py\n- scripts/run_tests.sh tests/agent/test_google_antigravity_cli_adapter.py tests/agent/test_auxiliary_named_custom_providers.py tests/hermes_cli/test_api_key_providers.py -q\n- live smoke: get_text_auxiliary_client('compression') resolves GoogleAntigravityCLIClient and call_llm returns COMPRESS_AGY_OK