Skip to content

Support agy (Antigravity CLI) as an architect #1063

Description

@mohidmakhdoomi

Follow-up from #929 / #1059

Split out from #929 (which ships codex-only architect support). The Gemini CLI is retired 2026-06-18 (#778); its successor is Google's Antigravity CLI (agy), already used by Codev's consult lane. This issue tracks bringing agy to parity with claude/codex as a Codev architect.

Why it was deferred (the hard part)

agy has no system-prompt / model-instructions channel for injecting the architect role out-of-band, unlike the other harnesses:

  • claude --append-system-prompt, codex -c model_instructions_file=, gemini (retired) GEMINI_SYSTEM_MD.
  • agy's only per-session channel is --prompt-interactive "<role>", which puts the architect role in the first user turn — visible (agy "answers" it) and weaker / less durable than a system prompt over a long session.
  • Other channels are unsuitable: the workspace AGENTS.md clobbers the committed file; the global ~/.gemini customizations root pollutes every agy session and races across architects.

Shipping a degraded architect was judged worse than none, so 929 went codex-only and this was split out. Validating role-holding quality is the crux of this issue.

What's already in place (reuse, don't rebuild)

  • Harness seam (HarnessProvider, agent-farm/utils/harness.ts) including the engine-neutral buildResume crash-loop fix from Support codex as an architect (PIR #929) #1059 — a new AGY_HARNESS plugs in here.
  • agy binary resolution already solved for consult: resolveAgyBin() / isRealAgyCli() / agyRespondsToVersion() in packages/codev/src/commands/consult/index.ts (guards against launching the Antigravity IDE launcher symlink instead of the headless CLI). Extract to a shared module and reuse.
  • agy reads AGENTS.md natively (codex-like) — so no context/settings file is needed for project context; only the architect role needs a channel.

Scope (MVP)

  1. Add AGY_HARNESS (keyed agy) selectable via .codev/config.json (shell.architect: "agy …" / shell.architectHarness: "agy").
    • Interactive launch: agy --dangerously-skip-permissions --prompt-interactive "<role>".
    • Role injection via the first-turn prompt (no system-prompt flag). Empirically validate role-holding — if poor, investigate framing the role as config, or wait for agy to add a system-prompt mechanism.
    • Binary resolution via the extracted resolveAgyBin guard.
    • Resume deferred: buildResume → null (fresh launch). agy supports --continue / --conversation for a later resume-parity pass.
    • resolveBinary? seam on HarnessProvider, applied at all architect executable-determination sites (no-Tower architect.ts, main + sibling launch in tower-instances.ts, reconnect / auto-restart in tower-terminals.ts).
  2. doctor affirms agy as a supported architect.
  3. Tests: agy arg construction, resume-skip → fresh launch, resolveBinary substitution incl. the reconnect path, harness detection.
  4. Docs: arch.md architect-harness subsection.

Acceptance criteria

  • afx architect (no-Tower), afx workspace start (clean + stale-Claude-.jsonl-present → no crash-loop, no --resume), and afx workspace add-architect all launch the real agy CLI (not the IDE) with the role applied.
  • afx send single-line / multi-line (>3) / --interrupt / while-streaming deliver on agy's TUI (add a per-harness submit strategy if flaky).
  • Tower stop→start reconnect + shellper auto-restart relaunch the agy architect (real bin).
  • A builder spawned by an agy architect preserves CODEV_ARCHITECT_NAME affinity.

Recommended protocol

PIR — needs running-app validation of role-injection quality at the dev-approval gate (the reason this was split out).

References

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