Skip to content

Add Google Antigravity CLI (agy) as a harness via print mode (no native ACP) #102

Description

@sanirudh17

Summary

Google Antigravity CLI (agy) currently has no native ACP — the upstream request for --acp (google-antigravity/antigravity-cli#31) remains open — so it cannot plug into Zeron's shared AcpHarness today. The stable automation surface is its print mode (agy -p / --print): spawn agy as a subprocess, feed it one prompt, capture the single output block, and render it as the turn.

Solution: add a print-mode subprocess harness in zeron-harness (the crate that already hosts the claude-code and codex subprocess adapters), behind a stable HarnessId::Antigravity. When upstream #31 lands, the adapter migrates to AcpHarness under the same HarnessId — keeping it behind the Harness trait makes that migration additive.

Print-mode contract

From google-antigravity/antigravity-cli#31, agy v1.0.0 exposes only:

Mode Streaming Tool approval Cancel Conversation state
Default TUI
-i / --prompt-interactive
-p / --print ❌ (single block) ❌ (--dangerously-skip-permissions only) New each invocation

-p is the only non-interactive mode, so it is the integration surface.

Solution / proposed scope

  • Add HarnessId::Antigravity and a print-mode harness in zeron-harness — spawn agy -p, capture the single output block, and emit it as the turn's assistant message (mirror the existing subprocess adapters; do not route through AcpHarness).
  • Binary discovery: AGY_EXECUTABLE / ANTIGRAVITY_EXECUTABLE override + PATH/login-shell discovery. Install: curl -fsSL https://antigravity.google/cli/install.sh | bash (Linux/macOS); install.ps1 / install.cmd (Windows).
  • Prompt contract: one turn per invocation, cwd = the session's space; confirm the exact prompt-passing shape from agy --help during implementation.
  • Permissions: print mode cannot do interactive tool approval → select --sandbox vs --dangerously-skip-permissions behind Zeron's permission settings; tool calls surface post-hoc in the transcript.
  • Auth: agy authenticates via the system keyring with browser fallback, and on SSH/headless prints an authorization URL — slot into the existing agent-accounts credential handling (macOS Keychain via security-framework already exists in the engine).
  • Models/options: agy reads ~/.gemini/antigravity-cli/settings.json; expose a model picker by parsing/overriding that config. No ACP configOptions discovery available.
  • Image attachments: supported. Images attached in the chat (the composer already supports drag-drop/paste) are forwarded to agy by referencing their local file paths in the -p prompt, and rendered in the transcript via the existing attachment pipeline. Native image paste into the CLI itself is an open upstream gap (Feature Request: Support pasting images directly into the CLI google-antigravity/antigravity-cli#38), so path-based references are the mechanism.
  • Steering: turn-boundary only — steers dispatch as the next turn via the existing command plane.
  • Cancellation: print mode has no cancel → kill the child process on interrupt.
  • Liveness: print mode emits a single block only on completion → long silent turns (compaction / long reasoning) will trip the engine's quiet-settle watchdog; extend the existing quiet-settle exemption (Exempt Pi from the 30s ACP quiet-settle #98) to Antigravity so a live turn isn't force-settled as Failed.
  • Register lazily and expose through Settings / harness pickers, matching the other providers.

Known limitations (accepted for this integration)

  • No resume / no conversation state in print mode: each invocation starts a fresh session ("New each invocation" per Harness settings page, model prefetch, picker highlight fix #31). Each turn is treated as independent; context is re-established by folding the transcript into the prompt.
  • No incremental streaming: the transcript updates at turn completion; the turn stays Working until the child exits — hence the quiet-settle exemption above.
  • No native image paste into the CLI: upstream Bootstrap checkpoint heals dep-hole chat2 rooms #38 is open; attached images are forwarded by file path instead and rendered in the transcript.
  • Windows: agy ships Windows installers, but Zeron's gpui_platform features in this repo target Linux/macOS — the harness itself is platform-neutral, so coverage/CI can stay Linux-only.

Test coverage

  • install/discovery: binary detection, --version, env override
  • spawn: cwd + prompt-arg shape
  • single-turn run: output block captured as the turn's assistant message
  • cancellation: child kill on interrupt
  • permission-flag selection behind settings (--sandbox vs --dangerously-skip-permissions)
  • settings.json model/options parsing
  • attachments: an image attached in the chat is referenced in the agy -p prompt and displayed in the transcript
  • quiet-settle exemption: a long silent turn survives the watchdog
  • real agy -p smoke test where a signed-in agy is available

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions