summaryrefslogtreecommitdiff
path: root/docs/findings.md
blob: 8b5efd7b239407bc82bbc74848bf9c2333449f2e (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
# Antigravity provider evidence

## Steering and thinking (agy 1.5.21)

A live, isolated Neon Low turn returned its MCP marker plus both independently injected words: one from plain Enter while busy, one from `ext.agent:submit` inside the tool. The adapter sends the ordered text tail after the matched result as a concurrent ACP `session/prompt`, then returns the original MCP result once. Each request gets its own ID and only the original and all steering replies together complete the Panto turn. Both replies can carry distinct usage (observed 833 + 1044 tokens); the footer sums reported counts once. See [Google’s ACP steering contract](https://antigravity.google/docs/cli/acp/).

Agent-sent `agent_thought_chunk` text routes separately to Panto’s thinking component, preserving its position among answer chunks and tools. A fake ACP peer verified the render event and checkpoint continuity. Neither the live Low probe nor a High arithmetic follow-up emitted a thought chunk; choosing a reasoning level does not guarantee displayable text. No reconstruction from logs or token counts.

## Subscription meter (offline)

The bundled `agy` changelog for 1.1.11 documents `-p "/usage"` as a read-only print command that spends no model turn. Static inspection of **1.5.18** (`printmode.quotaRows`, `bucketRemaining`, `bucketReset`, `headless.writeRows`) established the piped record: group, bucket, **remaining**, UTC reset. A raw count has no denominator and cannot yield a percentage. This is an allowance reading, not ACP context occupancy or an estimate from token counts. The signed CLI also returned four-column TSV with `--gemini_dir <private profile> --sandbox -p /usage` in 1.5.19. Print mode rejects the ACP flags `--gemini-dir` and `--disable-telemetry`. The footer checks the exit status and records directly, without asking for a version.

## ACP isolation (agy 1.5.21)

The installed CLI's `agy help acp` advertises `--agent` and `--include-default-customizations`. Its bundled changelog documents `excludeDefaultComponents` (1.2.1) and the MCP `antigravity/alwaysLoad` tool hint (1.3.3). A network-blocked `initialize` advertised system-prompt **append**, not override or a tool-inventory query. In a temporary home, `agy agents` listed a main-agent definition with an explicit stdio MCP entry. Discovery is not proof that the executor loaded its tools.

In an authenticated startup probe with an inert local relay, `session/new` with the relay only in the agent definition went 11 seconds without `tools/list`. With the same descriptor also in ACP `mcpServers`, fresh processes called `tools/list` before replying to both `session/new` and `session/resume`. No `session/prompt` was sent. The adapter now uses that handshake rather than waiting for rewrites in a shared on-disk cache.

The provider selects a custom main agent, disallows inherited tools/customizations in its definition, and puts the one relay directly in that definition rather than expecting the selected agent to inherit `session/new.mcpServers`. The offline TUI fixture launches that relay and dispatches a tool on new and resumed sessions. It does not run Google's executor. Use the fresh-marker checks in the README when upgrading; agy may retain infrastructure declarations even if native workspace actions are absent. A model listing names, a `tools/list` request, and successful execution are three different observations.

Live Rex checks on `agy` 1.5.21 with a fresh `antigravity:gemini-4-neon -r low` verified a first-turn Panto `std.read` card and the correct file line. Neon described the Panto role and tool guidance and reported three unprefixed declarations: `list_resources`, `read_resource`, `manage_task`. A disposable rig adding `excludeFundamentalComponents`, `disallowedTools` and `disabledTools` to the agent frontmatter produced the same three names; none of those trial keys shipped. With the production agent definition and `tools = []`, Neon reported only `manage_task` and could not retrieve a fresh file marker. The frontend tool list is self-reported, not an ACP inventory. The usage footer showed numbers before any prompt through the signed CLI's `/usage` command.

A subsequent 1.5.21 Rex probe called `manage_task` (list only) and `mcp_pantograph_std__read` in one turn. ACP sent distinct tool-call IDs and start/completion statuses for both. `session/prompt` returned `inputTokens=2166`, `outputTokens=228`, `thoughtTokens=117`, `totalTokens=2394` with zero cache reads/writes. The latest `usage_update` instead said `used=1330, size=1048576`. A one-word follow-up returned 1418 total tokens: the prompt totals are not cumulative session usage. Panto records usage on final completion only and prices it from model config, not Google endpoints. Real nonzero cache splits have not been independently audited.

Current [Terms §6](https://antigravity.google/terms/) explicitly permit supported ACP, headless, MCP and custom-agent interfaces while separately prohibiting direct entitlement use and raw-model proxying. `agy` owns the turn and asks Panto for tool results over MCP. The older references below are historical, not a promise about enforcement.

## Native tool switch (agy 1.5.19)

An unauthenticated ACP probe in a temporary profile sent `_meta.disableBuiltInTools` with both `session/new` and `session/resume`. Both methods rejected a string with `-32602` (expected bool at `_meta.disableBuiltInTools`); `true` passed decoding and reached `Authentication required`. A string at the top level or under `_meta.antigravity` was ignored. This verifies the wire field, not the tool inventory of a signed-in Neon turn. `check.lua` tests both outbound envelopes and actual MCP listing/dispatch through the Panto TUI with a fake peer. For the live check use the read-card and `/antigravity-status` procedure in the README.

## Subscription spike (November 2026)

- The operator reported a successful human-driven marker conversation and follow-up. The first answer depended on a fresh Panto Lua result; the second turn stayed in the ACP session. No live transcript, model ID, tier or credentials were recorded. This established the integration pattern, not general rig compatibility or Google approval.
- Offline, signed `agy 1.5.18` advertised ACP v1, native `oauth-personal`, prompt append, and session resume. A fully network-blocked `session/new` stopped at the CLI’s own loopback listener; that was not an authentication result. Saved-session behavior, model-change handling and cancellation were exercised with a fake ACP peer, not a live account.
- ACP owns the conversation, model selection, permissions and follow-up inference. MCP carries tool calls; ACP tool updates must never execute them a second time. Use the account’s advertised Gemini choices, no transcript replay, proxying, autonomous delegation, account rotation or billing fallback.
- A command cannot dispatch tools directly on the borrowed primary agent. Copying tool declarations to an owned child retained the original handler closure but changed its session identity. Waiting in `run_foreground` blocked the primary loop. A local-only Panto protocol instead emitted native tool events on the primary thread; the MCP relay could restart without moving the handler. Interrupting the host removed its private endpoint.
- Additional MCP tools do not imply exclusive dispatch. Neither suppression of native tools nor isolation from other configured servers was established. Do not expose delegation tools on the personal route.
- Reference: [Google ACP editor guide](https://antigravity.google/docs/ide/extensions/acp), [Terms §6](https://antigravity.google/terms), [T3/Zed clarification](https://discuss.ai.google.dev/t/197131/3), [disputed narrower interpretation](https://discuss.ai.google.dev/t/202970/5), [delegation guidance](https://discuss.ai.google.dev/t/203835/7), [pinned T3 adapter](https://github.com/pingdotgg/t3code/blob/6f2e02c1e10a4e4b1d9eb41d55e49ac4b606344b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts#L165-L169). T3’s precedent is an additive instruction and a per-session MCP descriptor, not a replacement system prompt.

## User-message cap (agy 1.5.22, December 2026)

A cold `/tree` reseed of a 756 KB transcript answered the session's first prompt: agy's stored model request kept the first ~191 KB and replaced the rest with `<truncated 564622 bytes>`, dropping the current request. Live Hydrogen probes with marker tokens (standalone ACP client, private profile):

- 492 KB as four `text` blocks in one `session/prompt`: joined, then cut at the same point (`<truncated 300389 bytes>`); question lost. Four `resource` blocks (`embeddedContext` is advertised): same result.
- The same bytes in `_meta.antigravity.systemPrompt.append`: complete at 492 KB (149k input tokens) and 1.48 MB (433k).
- Four `session/prompt` requests sent without waiting: each became its own user message, uncut, but stored out of order (part 2, question, part 1, part 3). Staggered 300 ms they arrived in order, yet ACP gives no per-prompt acknowledgement, so the order is a timing race. With 2 KB parts: no delay gave one model call in a different shuffled order every run; 20–100 ms between every send kept order but the first part ran its own model call; a short opener, one 20 ms wait, then a burst was shuffled in 4 of 4 runs and the opener's reply leaked as visible text in 2.
- Awaiting each part's reply is ordered but costs a model call and an agy-only assistant turn per part. Rejected.
- `resource_link` blocks: the model receives the path only. MCP tool results are cut to ~9.9 KB and `resources/read` bodies are spilled to a file (see the next section), so no tool route can carry a transcript.
- Overflow split, 246 KB in the append plus a 103 KB user message: one model call (107k input tokens), every marker present and in order in the stored model request, nothing truncated. After `session/resume` in a fresh process with no append re-sent, the model quoted a line from the append it had never output, with 106,982 cached-read tokens. A resume that does send an append takes effect too; whether it replaces or adds to the stored one is untested and the adapter never does it.

The adapter therefore keeps one user message and moves only the older history that does not fit into the system prompt append of the new session. Costs: that history sits at system level, framed as a record; agy's own context management cannot reclaim it; and agy appears to store the append with every user step, so a seeded conversation's database grows by about the record's size per turn. In the probe a one-line prompt after resume was stored as a 250 KB step; in ordinary sessions every user step is ~12 KB regardless of prompt length, consistent with it carrying the rig instructions. This is disk only: the resumed call read the record from cache.

## MCP tool result cap (agy 1.5.23, December 2026)

agy cuts the middle out of a large MCP tool result before the model sees it: it keeps the head and tail, inserts `<truncated N of M bytes from the middle of the output>` and prefixes `The tool's output was truncated due to being too long. You can find the full output in a file at file:///…/brain/<session>/.system_generated/steps/<n>/output.txt.` The model cannot read that file: native tools are disabled, and reading it through a Panto tool hits the same cap. Panto's transcript kept the full result, so the TUI showed output the model never received.

- Size. In the profile's conversation databases about 140 tool results carry the marker, each stored at 10,237–10,240 bytes, from originals up to 816,745 bytes. The largest unmarked relay result is 10,214 bytes. The stored text includes agy's own `Created At` / `Completed At` header (78 bytes), so about 10,160 bytes of payload fit. The binary's embedded default flags contain `"tool-output-max-bytes": 10240`, and its changelog for 1.4.7 says MCP results "of up to 10 KB" are returned directly. The limit is bytes, not tokens.
- No setting found. Agent frontmatter keys, `settings.json` keys in the changelog and the `AGY_*` environment names in the binary offer nothing for it. Internal config fields exist (`mcp_max_output_bytes`, `ToolOutputConfig.max_output_bytes`), but no user-facing route to them was found. Overriding flags through `AGY_CLI_VARIANTS` or rewriting results with a `PostToolUse` hook (`overwriteResult`, 1.5.21) was not tried.
- Per result, not per block (live Hydrogen, standalone ACP client, marker tokens). Four 8 KB `text` blocks in one result were joined and cut as one (`<truncated 23293 of 33155 bytes …>`, 2 of 8 markers reached the model request). Two 8 KB embedded `resource` blocks: same (`6788 of 16650`). A 20 KB `resources/read` body is not inlined at all; it goes to a `resource_0.txt` spill file.
- Parts work. The same 33 KB served as four results of at most 9.6 KB, the first ending with a notice naming a `result_part` tool: the model requested parts 2–4 in a single response, all 8 markers were in the final model request, nothing was truncated. Three model calls in total; agy ran the three part calls one after another, about 1.2 s each.
- Not checked: whether image blocks count toward the cap. An earlier 65 KB `std__read` step without a marker turned out to be 58 KB of thought signature around a small result.

The relay therefore sends text over 10,000 bytes in parts of at most 9,600 bytes and answers `result_part` itself from the eight most recent large results. The tool runs once; Panto never sees the part requests.