feat(antigravity): add Antigravity CLI (agy) provider#323
feat(antigravity): add Antigravity CLI (agy) provider#323MarkusWohlmuth wants to merge 3 commits into
Conversation
Adds an AntigravityCliProvider so CAO can drive Google's Antigravity CLI (`agy`), the terminal successor to the Gemini CLI after the free Gemini Code Assist login was retired (2026-06-18). - New provider modeled on cursor_cli/gemini_cli: launches `agy --dangerously-skip-permissions [--model] [-i <system prompt>]`, footer-anchored status detection (`esc to cancel` -> PROCESSING, `? for shortcuts` -> IDLE/COMPLETED split on a turn counter), structural response extraction, MCP servers written to ~/.gemini/config/mcp_config.json with CAO_TERMINAL_ID forwarded, `/quit` exit. - Registered: ProviderType.ANTIGRAVITY_CLI, manager branch, tool_mapping, RUNTIME_SKILL_PROMPT_PROVIDERS, SOFT_ENFORCEMENT_PROVIDERS, provider_binaries. - Unit tests (status/extraction/command/MCP) with captured TUI fixtures. - docs/antigravity-cli.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
=======================================
Coverage ? 14.69%
=======================================
Files ? 76
Lines ? 7670
Branches ? 0
=======================================
Hits ? 1127
Misses ? 6543
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@MarkusWohlmuth Thanks for your contribution! This is a much needed PR as the antigravity cli replaces gemini cli as the new Google Cli. Can you please make sure that the new provider pass the You can also refer to the skill https://github.com/awslabs/cli-agent-orchestrator/tree/main/skills/cao-provider for the new provider. Also please address the copilot's reviews, and fix the CI errors and Codecov Report. Much appreciated! |
There was a problem hiding this comment.
Pull request overview
Adds a new antigravity_cli provider so CLI Agent Orchestrator can drive Google’s Antigravity CLI (agy) in a tmux-backed interactive TUI session, including status detection, response extraction, and MCP server wiring.
Changes:
- Introduces
AntigravityCliProviderwith footer-anchored status detection, response extraction, launch command construction, and MCP config merge/cleanup. - Registers the new provider across the orchestrator (provider type enum, provider manager, runtime skill prompt + soft enforcement sets, API provider listing, and tool mapping).
- Adds unit tests plus captured TUI fixtures and user-facing documentation for setup/usage.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/providers/test_antigravity_cli_unit.py | Unit tests for status detection, extraction, command building, and MCP config lifecycle. |
| test/providers/fixtures/agy_review_completed.txt | Captured “completed” TUI output fixture used by extraction tests. |
| test/providers/fixtures/agy_processing.txt | Captured “processing” TUI output fixture used by status tests. |
| test/providers/fixtures/agy_idle.txt | Captured “idle” TUI output fixture used by status tests. |
| test/providers/fixtures/agy_completed.txt | Captured “completed” TUI output fixture used by status tests. |
| src/cli_agent_orchestrator/utils/tool_mapping.py | Adds CAO→native tool mapping for antigravity_cli. |
| src/cli_agent_orchestrator/services/terminal_service.py | Includes antigravity_cli in runtime skill prompt + soft enforcement provider sets. |
| src/cli_agent_orchestrator/providers/manager.py | Wires provider creation branch for ProviderType.ANTIGRAVITY_CLI. |
| src/cli_agent_orchestrator/providers/antigravity_cli.py | New provider implementation (launch, MCP config, status detection, extraction, cleanup). |
| src/cli_agent_orchestrator/models/provider.py | Adds ANTIGRAVITY_CLI to ProviderType enum. |
| src/cli_agent_orchestrator/api/main.py | Adds antigravity_cli → agy to /agents/providers binary probe list. |
| docs/antigravity-cli.md | Documentation for installing/configuring/using the new provider. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # mark_input_received(), which the terminal service calls after every | ||
| # send_input(). This keeps the handoff/assign "wait for IDLE before | ||
| # sending the task" contract working right after init. | ||
| self._turns: int = 0 | ||
|
|
||
| # ------------------------------------------------------------------ # |
| 2. PROCESSING — footer "esc to cancel" (or a spinner line) in the tail | ||
| 3. WAITING_USER_ANSWER — an interactive approval / picker prompt | ||
| 4. IDLE / COMPLETED — footer "? for shortcuts" (IDLE pre-first-turn, | ||
| COMPLETED after) |
| markuswohlmuth@MacBook-Pro cli-agent-orchestrator % cd '/tmp/agy_onb/work' && agy --dangerously-skip-permissions | ||
|
|
||
| ▄▀▀▄ Antigravity CLI 1.0.10 | ||
| ▀▀▀▀▀▀ markus.wohlmuth@bitmovin.com (Antigravity Starter Quota) | ||
| ▀▀▀▀▀▀▀▀ Gemini 3.5 Flash (Medium) |
| markuswohlmuth@MacBook-Pro cli-agent-orchestrator % cd '/tmp/agy_onb/work' && agy --dangerously-skip-permissions | ||
|
|
||
| ▄▀▀▄ Antigravity CLI 1.0.10 | ||
| ▀▀▀▀▀▀ markus.wohlmuth@bitmovin.com (Antigravity Starter Quota) | ||
| ▀▀▀▀▀▀▀▀ Gemini 3.5 Flash (Medium) |
| markuswohlmuth@MacBook-Pro cli-agent-orchestrator % cd '/tmp/agy_onb/work' && agy --dangerously-skip-permissions | ||
|
|
||
| ▄▀▀▄ Antigravity CLI 1.0.10 | ||
| ▀▀▀▀▀▀ markus.wohlmuth@bitmovin.com (Antigravity Starter Quota) | ||
| ▀▀▀▀▀▀▀▀ Gemini 3.5 Flash (Medium) |
| ▸ Thought for 2s, 608 tokens | ||
| Prioritizing Tool Usage | ||
|
|
||
| ● Read(/Users/markuswohlmuth/.gemini/antigravity-cli/mcp/cao-mcp-server/load_skill.json) (ctrl+o to expand) |
- opt into blocks_orchestrated_input_while_waiting_user_answer so agy approval/picker prompts don't consume orchestrated assign/handoff messages - correct get_status docstring priority order (WAITING_USER_ANSWER before PROCESSING, matching implementation) - redact PII from test fixtures (email, hostname, home directory paths) - add antigravity_cli to PROVIDERS_REQUIRING_WORKSPACE_ACCESS - add examples/assign e2e tests (data_analyst, report_generator, callback) - assert antigravity_cli in /agents/providers endpoint tests - add dedicated CI workflow for the provider - document provider in README and CHANGELOG Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@haofeif thanks for the review! Just pushed Copilot review comments
examples/assign
CI / Codecov
One note on coverage: the e2e assign tests require a live |
agy redraws its footer in place, flipping "esc to cancel" (PROCESSING) to
"? for shortcuts" (IDLE) with cursor moves. The status monitor's raw
append-only pipe-pane stream keeps BOTH strings after strip_terminal_escapes,
so get_status() found the stale "esc to cancel" and latched PROCESSING
forever — the session never reached IDLE, POST /sessions blocked the full
180s init wait, and the CLI's 30s read timeout fired ("Failed to connect to
cao-server: Read timed out"). Every antigravity_cli launch failed, so the
provider could not pass examples/assign.
Fix: set supports_screen_detection = True and implement get_status_from_screen
against the pyte-composited viewport (mirroring claude_code / kimi_cli), where
the in-place footer rewrite is resolved and only the live footer remains.
Verified live: status monitor now transitions unknown -> idle in ~10s and
cao launch --provider antigravity_cli succeeds.
Adds unit tests for the screen detector plus a regression test asserting the
raw stream reports PROCESSING while the composited screen reports IDLE.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Adds an
AntigravityCliProviderso CAO can drive Google's Antigravity CLI (agy) — the terminal-native successor to the Gemini CLI. Google retired the free Gemini Code Assist "Login with Google" path for thegeminibinary on 2026-06-18 and is steering users to Antigravity, so teams relying on thegemini_cliprovider for an independent-model worker need a path forward.How it works
Modeled on the
cursor_cli/gemini_cliproviders:agy --dangerously-skip-permissions [--model "<name>"] [-i "<system prompt>"]. Models are the human-readable stringsagy modelsprints (e.g."Gemini 3.1 Pro (High)"). The profile body + skill catalog (+ security prompt when tool-restricted) is injected via-iwith an "acknowledge your role and wait" guard so the agent adopts its role without exploring on launch.esc to cancel→ PROCESSING;? for shortcuts→ IDLE/COMPLETED, split on a turn counter (the TUI footer is identical in both states — same approach ascursor_cli). Survivesstrip_terminal_escapes.> <query>line and the input-box separator, filtering TUI chrome (banner, separators, footer, tips, spinner,▸thought lines,●tool-call lines).mcpServersintoagy's~/.gemini/config/mcp_config.json(the fixed path it reads), forwardingCAO_TERMINAL_IDsocao-mcp-serverresolves the terminal for handoff/assign; removed on cleanup.ProviderType.ANTIGRAVITY_CLI, manager branch,tool_mapping,RUNTIME_SKILL_PROMPT_PROVIDERS,SOFT_ENFORCEMENT_PROVIDERS,provider_binaries./quit.Testing
test/providers/test_antigravity_cli_unit.py(18 tests) — status detection, extraction, command building, MCP config write/cleanup — against captured live-TUI fixtures. Full provider suite green (872 passed).agy(Gemini 3.1 Pro (High)). Verified: agy boots, the-isystem prompt + skill catalog inject, role adoption, IDLE→PROCESSING→COMPLETED transitions, andcao-mcp-serverconnects andload_skillis invoked (confirming theCAO_TERMINAL_IDwiring). The agent returned a structured review (Verdict: CHANGES_REQUESTED).Notes / limitations
agyexposes no native hard deny flag, so the provider is inSOFT_ENFORCEMENT_PROVIDERS.agyreads MCP config from a single fixed path; concurrent terminals share it. This is safe under CAO's serialized launch (each agy reads the config and spawns its MCP subprocess before the next terminal writes), matching thegemini_cliprovider's existing model.agyoccasionally shows a server-driven feedback survey; it auto-dismisses on normal text input, so it does not affect task delivery.docs/antigravity-cli.md.Happy to file a tracking issue first if that's preferred per CONTRIBUTING — opening this as a draft for visibility.
🤖 Generated with Claude Code