Files
hermes-agent/tools/environments
John Paul Soliva 66186a8c04 fix(environments): deliver heredoc stdin byte-exact
A heredoc body always ends in a newline, so on the heredoc-stdin backends
(Modal, Daytona, Vercel) every stdin payload arrived with one extra byte.
write_file and patch verify an exact sha256 of the written file, so even
with the command grouped every write failed verification and left
content + "\n" on disk.

Feed the heredoc through a process substitution that re-emits the body
minus that last character. The heredoc stays outside <( ) because bash
3.2 mis-parses heredoc bodies inside it, and the reader tolerates read's
EOF status under an inherited set -e.

The tool-result spill no longer needs its +1 byte allowance for heredoc
mode, so the size check is exact on every backend again.
2026-09-25 14:14:06 -04:00
..