caelum0x 2e9ca56c36 fix(cli): stop railyard logs from buffering an unbounded tail in memory
`run()` always appended every stdout/stderr chunk from a child process onto
accumulator strings, even for `railyard logs` (wraps `wrangler tail`), which
only ever reads the exit code and can stream for hours -- so a long session
held every log line it had ever printed in memory for no reason. Added a
`capture` option (default true, unchanged for deploy/rollback which do need
the text back) and set `capture: false` for logs.

Load-tested the fix for real: a new fake-wrangler `tail` fixture that
behaves like the real thing (streams until killed, never exits on its own),
a 4,000-line end-to-end `railyard logs` test (every line still streamed
live, saved token redacted, --format/--status forwarded correctly), a
Ctrl+C-style signal-stop test, and a direct run() test proving capture:false
keeps result.stdout/stderr empty across 20,000 printed lines while
capture:true is unchanged. 28/28 CLI tests passing (23 pre-existing + 5 new).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-24 04:53:23 +03:00
..