# agy acp T0 capability probe (agy 1.5.3)

Refs #1280 (P2), #485. Model-free: `initialize` and `session/new` only, no prompt, no credential read. Run with `AGY_CLI_DISABLE_AUTO_UPDATE=1`.

Two runs: run 1 under the person's real home (a mistake against the planner ruling, cleaned up below) and run 2 under a disposable HOME (the isolated run of record).

## Run 1 (person's home, cleaned up)

The person's existing login was in scope, so `session/new` succeeded and created session state. Exactly these files were created by the probe and removed; nothing else in that home was touched:

- `~/.gemini/antigravity-cli/conversations/<sessionId>.db`
- `~/.gemini/antigravity-cli/brain/<sessionId>/` (empty `scratch/` and `.user_uploaded/`)
- `~/.gemini/antigravity-cli/log/acp-server-20261108_000903-24787.log` and `acp-server-20261108_000951-32157.log`

An `implicit/*.pb` file with a nearby mtime is not referenced by the probe's log and was left alone.

## Method

- `agy --version` prints `1.5.3`.
- `agy acp` on stdio, newline-delimited JSON-RPC 2.0.
- Request 1: `initialize` with `protocolVersion: 1` and empty `clientCapabilities`.
- Request 2: `session/new` with `cwd` set to a scratch directory and `mcpServers: []`.

## Run 2 (isolated HOME, the run of record)

`HOME` and `XDG_CONFIG_HOME` pointed at a fresh temp directory, no account. `initialize` answered exactly as in run 1 (same capabilities and `authMethods`). `session/new` was refused: `{"code":-32000,"message":"Authentication required"}`. The process wrote only under the temp home (`.gemini/config`, `.gemini/antigravity-cli`: state, installation id, one `acp-server` log, builtin plugins); the directory was removed afterwards.

Finding: `initialize` needs no login; `session/new` and everything after it need one of the four `authMethods`, so a hub-owned headless `agy acp` needs a person-provided login or API key and cannot be probed beyond `initialize` without one.

## Observed in run 1 (person's home)

- `initialize` result: `protocolVersion: 1`, `agentInfo` `Antigravity ACP Server` `1.5.3`.
  - `agentCapabilities.loadSession: true`.
  - `promptCapabilities`: image true, audio false, embeddedContext true.
  - `sessionCapabilities`: `resume`, `close`, `load`, `list`, `additionalDirectories`.
  - `_meta.antigravity`: `tier`, `systemPrompt.append`.
  - `authMethods`: `oauth-personal`, `oauth-business`, `gemini-api-key`, `agent-platform`.
- `session/new` result with the person's existing login: a `sessionId`, `models` (13 ids, `currentModelId` `gemini-4-argon-medium`), `modes` (`default`, `accept-edits`, `plan`; current `default`), and `configOptions` `model`, `thought_level`, `mode`.

## Maps onto the hub's ACP surface

- Native modes `default`, `accept-edits`, `plan` map one to one to the hub's `ask`, `accept-edits` and `plan` permission modes.
- `session/resume`, `session/load` and `session/close` exist, so the hub's restore path (`restoreArgs`) can resume an agy session by id.
- `additionalDirectories` gives the hub a way to scope extra roots without a TUI flag.
- `models` and `thought_level` are selectable through `configOptions`, so `launch.model` can be passed through.

## Not proven here (blockers for wiring `AcpPeer`)

- No prompt was sent, so these are unverified: `session/prompt` streaming shape and `stopReason` values, `session/cancel`, mid-turn steering, `session/request_permission` payloads and their option ids, and `usage_update` or token fields.
- Whether `agy acp` honours the managed hooks (`hooks.json`) or a separate approval path; the TUI hook floor (#1280 P1) may not apply to ACP turns.
- Whether `mcpServers` passed to `session/new` load the hub MCP server for a headless peer.
- Authentication of a hub-owned process: run 2 shows it is required; how the hub would supply it without reading a credential is open.

## Decision

Probe receipt recorded; `AcpPeer` wiring for `agy` stays out of this change. Wiring needs one authorized model-backed turn to prove the prompt, permission and cancel legs, which the person must approve (it spends quota). Follow-up: a task for the model-backed receipt, then the `ahub agy --mode headless` and `ahub watch agy` wiring.
