--plain output silently truncated when stdout is a pipe (console.log drops data on EAGAIN); --json unaffected
backlog task view <ID> --plain (also the non-TTY default view, task list --plain, search --plain and other console.log-based plain output) loses output when stdout is a pipe and the output is larger than the pipe's free space. The process exits 0 with no marker, often mid-line. Reproduced on 1.50.1 and 1.55.3 (linux-x64, embedded Bun 1.3.14).
Repro: a task whose plain view exceeds the pipe capacity (64 KiB by default; 8 KiB once a user hits fs.pipe-user-pages-soft, or on any pipe shrunk with F_SETPIPE_SZ): backlog task view TASK-1 --plain | (sleep 1; wc -c) gives exactly the pipe size, while > file gives the full length.
strace: the Bun runtime sets O_NONBLOCK on stdout; write(1, ..., 16043) = 8192, write(1, ..., 7851) = -1 EAGAIN, then exit_group(0). The JSON path (j5 → process.stdout.write) retries on EAGAIN and is always complete.
Why it matters: agents and scripts read tasks through pipes, and a silently shortened acceptance-criteria list has already led to near-destructive edits.
Suggested fix: print plain and text output through the same helper as JSON, e.g. function printText(s){ process.stdout.write(s.endsWith("\n") ? s : s + "\n"); }, instead of console.log(o9(task)) in the task, draft, list, and search plain handlers. Or, at the CLI entry point, await process.stdout drain before exit (await new Promise(r => process.stdout.write("", r))). A regression test: spawn the CLI with stdout on a pipe shrunk to 4096 bytes via F_SETPIPE_SZ, delay the reader, and assert the byte count equals the file-redirect count. The underlying Bun behaviour (console.log dropping bytes on EAGAIN for non-blocking stdout) may also deserve an oven-sh/bun report.
Correction from the reporter: re-testing the installed 1.55.3 release binary (embedded Bun 1.4.4) shows the plain output is now complete through pipes. strace shows write 8192, EAGAIN, then a retry until drained, instead of exiting after EAGAIN. Piped and file-redirected output were byte-identical for tasks up to 55 KiB, including slow readers. The truncation reproduces on 1.50.1 (Bun 1.3.14) but not on 1.55.3, so I'm closing this as already fixed. Sorry for the noise.