mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-22 19:08:48 +00:00
`println!` panics when stdout is a closed pipe, so `wordcraft-cli commands --json | head` aborted with exit 101. Every stdout write now goes through a locked handle with `writeln!` and propagates `io::Error`; a BrokenPipe becomes `Failure::StdoutClosed`, which `main` treats as a normal exit 0. The MCP stdio server's BrokenPipe takes the same path, so a client that hangs up ends the server cleanly. Real errors still go to stderr with exit 1. Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Brandon Thomas <[email protected]>