fn format_output(bytes: Vec<u8>, cap: u64) -> String
Shared output formatter: if we accumulated more than MAX_OUTPUT bytes, the stream was truncated — append a notice.