From 34d347ffb9ced22f6004af320958f9d1a0ae22d2 Mon Sep 17 00:00:00 2001 From: t Date: Thu, 3 Dec 2026 18:03:21 -0700 Subject: Page oversized MCP tool results to stay under agy's cap agy truncates any MCP tool result above about 10 KB before the model sees it, and splitting the text into several blocks does not avoid the cap. Results over 10,000 bytes now go out as parts of at most 9,600 bytes; the first part carries a notice and the model fetches the rest through a relay-only result_part tool. Panto still runs the tool once. Removes BUGS.md; the evidence moves to docs/findings.md. --- docs/findings.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/findings.md b/docs/findings.md index 467e395..8b5efd7 100644 --- a/docs/findings.md +++ b/docs/findings.md @@ -45,7 +45,19 @@ A cold `/tree` reseed of a 756 KB transcript answered the session's first prompt - 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 `BUGS.md`), so no tool route can carry a transcript. +- `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 `` 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//.system_generated/steps//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 (``, 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. -- cgit v1.3