mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-01 00:00:17 +08:00
Trident stage 1 dropped the assistant message that carried a file tool
use while keeping the tool result that answered it, so the compacted
session ended up with orphaned `tool_result` blocks. Providers reject
such requests with HTTP 400 ("tool_result blocks must be a response to
a preceding tool_use"), which breaks the auto-compact retry path that
runs Trident before resending a request.
Stage 1 also counted a tool result as an independent file operation,
which pushed `last_write` past the write the result belonged to and made
the newest write look obsolete.
Only tool uses count as file operations now, and a tool result is
dropped together with the tool use that produced it.