Files
plugins/packages/agy-cli/test
yetone dac9726736 agy-cli 0.1.44: a turn keeps only its current request body, and tool-result images are hashed in the history key (#1137)
A Codex tool loop with view_image screenshots grew the plugin host to
0.5-1.5 GiB after GC, so magpie recycled it every ~10 minutes and the
mid-turn conversation restarted without its tool outputs (tungloong's
report).

- Turn.registerResponse drops the previous step's body and
  contentSnapshot. Only the current step's are read again (a late
  prompt's estimate); the usage reducer reads settled/usage only.
- historyKey keys a tool_result image by mimeType + sha256, as it
  already keys a user's image, instead of copying its base64 into the
  key on every comparison.

Old data: a conversation parked before the update with an image inside
a tool result has a history hash taken over the raw bytes, so it starts
a new agy session once instead of resuming. Others are unchanged.

Run (mote, sandbox HOME): node --test conversation-key, step-usage,
usage-settlement, repeat-batch, compat: 128 pass. bun test: 21 pass.
scripts/check.mjs ok. Broken by hand: with origin/main's index.mjs both
new tests in conversation-key.mjs fail (2 of 33).
Not tried: a real Codex Desktop screenshot loop; heap size not measured.
2026-11-14 17:11:03 +08:00
..