Files
plugins/packages/agy-cli/test
yetone 6e0cecb2a0 agy-cli 0.1.45: a tool result's image goes to agy as a prompt image, not an offloaded file (distinceeeee on X)
Report: on agy-cli 0.1.43 with agy 1.5.8, when OpenCode's read tool
returns a screenshot, agy writes the image to
.system_generated/steps/N/media_0.jpg. The model never sees the image and
keeps re-reading files.

Cause: the bridge answered agy's MCP tools/call with the image as MCP
image content. agy offloads MCP images to a file, and its model only gets
"Image read successfully [Resource offloaded to file://…]". There are no
image tokens, so it loops trying to get the image back.

Fix: when agy supports prompt images and a tool result carries an image,
the result takes the steer-in-session path. The MCP call is answered with
its text plus a line saying the image follows. The image goes in the next
session/prompt as an ACP image block, in the same session, so it reaches
the model as an image. withoutAnswered keeps an answered result's images
in the prompt and drops the rest. If steering fails, the existing replay
fallback already sends tool_result images as prompt images. An agy
without image support keeps the old MCP path.

Run:
- Real agy 1.5.8 (macOS), sandbox HOME and sandbox keychain,
  gemini-3.8-flash-high, through a harness that drives the plugin's fetch
  with an OpenCode-style read tool:
  - origin/main: shot.jpg and term.png each looped through 8 reads
    without an answer.
  - This change: 1 read each. shot.jpg was answered correctly
    ("PLUM-7342 ORBIT", red circle, blue square, green triangle).
    term.png was answered correctly twice (all five terminal lines,
    including "TOKEN: ZEBRA-5519", and the yellow rectangle).
- WSL magpie-desktop (Ubuntu 24.04), bun 1.4.2, temp HOME:
  - packages/agy-cli `bun test`: 21 pass, 0 fail.
  - `node test/smoke.mjs`: ALL OK (347 checks).
  - `bun scripts/check.mjs agy-cli`: ok.
- Broken by hand: smoke.mjs with origin/main's index.mjs fails exactly
  the two image checks this change adds or rewrites (2 FAILURES of 347).

Not tried:
- Gemini 4 Carbon: not offered to the test account.
- Real agy on Linux, and a real OpenCode front end.
- stream:true against real agy (the harness is non-streaming; smoke
  covers SSE).
2026-11-14 18:20:54 +08:00
..