summaryrefslogtreecommitdiff
path: root/README.md
blob: 3d2a8c5acc059a4bb3cca72e40ac10d080701ff1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# panto-antigravity
Chat with Gemini in the Panto TUI through Google's signed Antigravity CLI on macOS. The CLI handles sign-in; you don't need an API key or a separate Panto rig.

## Setup

Install Google's `agy` and use a Panto build with `request.tui_submission`. Add the provider to `config.toml`:

```toml
[extensions]
rocks = ["panto-antigravity"]

[providers.antigravity]
protocol = "antigravity-acp"
# tools = ["std.read"] # optional allowlist; [] exports none
```
In `models.toml`, use one entry per family, with the levels shown by `agy models` for your account:

```toml
[antigravity.gemini-4-neon]
reasoning_levels = ["low", "medium", "high", "xhigh"]
```

Start an interactive thread:

```sh
panto -m antigravity:gemini-4-neon -r high
```

`-r high` or Ctrl+R requests `high` for the next turn. On `agy` 1.5.19 the provider selects the ACP model first, then checks that model’s `thought_level` choices and confirms the requested level before prompting. Without an explicit level it leaves the ACP setting alone. Pickers that advertise suffixed model IDs still use those variants (exact configured ID, otherwise `medium` when no level is requested). Panto currently shows the protocol-wide levels in Ctrl+R, so a narrower family can reject an unavailable level; the provider never silently substitutes one. The same configuration works in a rig.

To load a checkout instead of the rock, replace `rocks` with `paths = ["/absolute/path/to/panto-antigravity/extensions"]`.

## Usage and context

ACP's final `session/prompt` usage feeds Panto's session totals, cache hit rate and model pricing once per completed turn, including turns with multiple tool calls. Set `input`, `output`, `cache_read` and `cache_write` (USD per million tokens) in the model's `models.toml` table to estimate cost. This is not a subscription charge. `usage_update` reports a separate context snapshot (`used`, `size`); a Panto build supporting `metadata.context_window` uses it instead of mistaking summed prompt inputs for context occupancy. The adapter publishes the latest snapshot at Panto tool boundaries as well as at final completion. A long turn can still show no reading (or the last reading) if agy hasn't sent a new snapshot; the adapter doesn't substitute cumulative cache traffic for occupancy. Missing or inconsistent token totals aren't estimated.

## Quota footer (TUI only)

One shared row across aliases alongside Claude, Codex, Copilot and OpenCode Go. It shows **percent used**, a five-cell bar and reset countdown per reported bucket (73% remaining → `27% ━────`). The TUI requests an initial reading on startup using the CLI’s fixed read-only `/usage` command, without sending a model prompt. While an enabled Antigravity model is selected, a three-minute timer refreshes the row even when no turn starts or finishes. Startup, timer and turn reads share a one-minute cooldown and never overlap. The extension reads only the signed CLI’s stdout: it never calls Google quota endpoints or reads account tokens. [Google’s `/usage` command](https://antigravity.google/docs/cli/commands/usage/) may itself refresh from Google’s backend. Malformed or failed reads show unavailable; expired/reset readings aren't shown as current. No token-count estimates or raw CLI messages. `usage_footer = false` opts a provider out. The footer validates the `/usage` output, not the CLI version.

## Login and diagnostics

`/antigravity-status` shows local connection state; `/antigravity-models` lists advertised families; for split ACP settings, levels are shown only for the selected model. Neither contacts Google. The isolated profile is `~/.local/share/panto-antigravity/google`. For native login once that directory exists: `agy acp --gemini-dir "$HOME/.local/share/panto-antigravity/google" --login`. Keep `HOME` unchanged so the CLI can find the macOS login Keychain. When upgrading from the prototype, update your extension path, protocol and model selection, then start a new thread. No credentials or old checkpoints are migrated automatically.

## Tool permissions

By default the `pantograph` MCP server exports the active Panto tools, including extension tools. They run with Panto's permissions, not agy's shell sandbox. Use a trusted rig; if it contains tools you don't want Neon to run, narrow `tools` or disable those extensions in the rig. Full input schemas are listed, including nested arrays and objects; an unsupported schema constraint rejects the call rather than disabling the catalog. ACP now selects a per-thread [custom main agent](https://antigravity.google/docs/subagents/) with `excludeDefaultComponents: true`, `tools: []`, and no inherited customizations or MCP. The agent file in the isolated profile declares only the thread's `pantograph` relay (none for `tools = []`); each exported tool requests eager loading so agy need not read schema files with a native tool. The same relay is passed explicitly to ACP `session/new` or `session/resume` so agy discovers it during setup. With tools exported, the adapter requires a live relay that served `tools/list` before sending the first prompt. Schema-cache timestamps are not used. The Panto rig prompt still uses ACP's advertised append extension.

**Slow tools:** The generated agy agent requests a 30-minute MCP timeout for its `pantograph` server. If agy times out an MCP call, the local tool may still finish. Panto records its result, but the adapter does not send it to a cancelled request, rerun the tool, or start a new prompt. The existing turn drains the result and any queued steering before it can finish.

### Native tool activity

During a prompt, reported ACP native calls such as `manage_task` appear above the input with their name and status. The component shows the latest six calls until the next prompt or session close; it isn't saved transcript history. It never executes tools or prints raw inputs/results. Calls through the Panto relay still get their ordinary Panto cards, not duplicates.

### Verify tool access

Restart Panto after each config change and use a fresh thread in a disposable workspace without other agents, hooks or MCP servers. Generate a fresh marker with `uuidgen > panto-probe.txt` before each test; don't paste its contents into chat.

1. Set `tools = ["std.read"]`. Ask Neon to read `panto-probe.txt` and return its contents. Require the exact marker **and** a Panto read card; `/antigravity-status` should count a call.
2. Set `tools = []`, regenerate the marker, and ask again, expressly allowing a native read or shell if available. Neon should not obtain the new marker. An exact match is an isolation failure. A refusal is behavioral evidence, not a complete inventory of tool declarations.

### Approvals

Every ACP chat launch uses `--dangerously-skip-permissions` and `--sandbox`, even with `tools = []`. This skips agy's approvals for native tools as well as MCP tools. Use a trusted rig. The Panto tool allowlist still applies, and the separate read-only `/usage` query is unchanged.

## Steering and thinking

Plain Enter during a tool-using turn steers at the next tool boundary. Queued text and workflow notices go to the same live agy session as user input, not as tool output. Ctrl+Enter queues a separate follow-up. Esc sends ACP `session/cancel` to stop the active turn while keeping the warm ACP session for the next prompt (force-killing `agy` if it does not settle within 3s). If an earlier failure left an unanswered text message, resume that Panto thread and press Ctrl+P (`/proceed`) in the idle TUI to send the pending message once; this requires the Panto build with direct `/proceed` provenance. Reload alone does not retry it. Ctrl+K shows thinking text **if agy sends it**; reasoning-token counts are not displayable text.

## Branch and resume

Matching live turns keep the warm ACP session. Exact saved checkpoints record their current tip in the isolated profile and resume natively via ACP `session/resume`. Otherwise, the next direct submission after `/tree` or a cold resume starts a new ACP session: Panto sends its selected `history_transcript` as background and the new request once, in a single user message. agy keeps only the first ~191 KB of a user message, so when the transcript and request exceed 160 KB the older part of the transcript goes into the new session's system prompt append, marked as a verbatim record rather than instructions, and the newest part stays in the user message with the request. Nothing is dropped, the order is kept and it is still one model call. A single request over ~159 KB is refused. Past tool calls and results are text, not dispatches. If Panto cannot supply the transcript for existing history, the turn fails rather than silently dropping context.

## Session boundaries

Only a direct idle TUI submission can start, resume or reseed an ACP session. Once a turn completes, extension-submitted text (including workflow completion notices) can continue the same live primary thread if its checkpoint still matches. This checks session continuity, not the text prefix or which extension submitted it. An explicit `panto -m antigravity:gemini-4-hydrogen -- "prompt"` in an interactive terminal counts as direct input; an automatic rig `PROMPT.md` does not. No print/proxy calls, child-provider requests, compaction or automatic retries. Direct input identifies a TUI path, not proof of personhood; don't automate this route. Keep the profile free of delegation hooks/servers and exclude delegation tools from the rig or use an explicit allowlist on this personal route. The relay supports text/image results. Force-kill can leave a stale socket, lock or generated `config/agents/panto-*.md` in the isolated profile: confirm the owner is gone before removing it.

## Offline release check

`PANTO=/path/to/provenance-aware/panto mise run check` exercises source and installed-rock loading, renders the real footer with a fake CLI, and checks tool execution, resume, and headless rejection. No installed `agy` or Google account is used. See `docs/findings.md` in the source repository for compatibility evidence.