Skip to content

feat(printer): Implement four-channel output model#519

Merged
JeanMertz merged 1 commit intomainfrom
prr87
Apr 7, 2026
Merged

feat(printer): Implement four-channel output model#519
JeanMertz merged 1 commit intomainfrom
prr87

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Implements RFD 048, separating JP's output into four distinct channels: stdout for assistant responses, stderr for chrome (tool headers, progress indicators), /dev/tty for interactive prompts, and a log file for tracing.

Printer gains a PrintTarget::Tty variant backed by /dev/tty on Unix and CONOUT$ on Windows. A new prompt_writer() method routes interactive prompts to the TTY when available, falling back to stdout. All tool renderers, retry notifications, and reasoning progress indicators are moved to err_writer(), keeping stdout clean for assistant output that downstream consumers can pipe or capture reliably.

Tracing is now written to a log file by default and suppressed on stderr unless explicitly requested via -v or --log-file=-. This keeps 2> chrome.log free of tracing noise. A new --log-file flag supports directing logs to an alternate destination, with --log-file=- restoring the previous behavior of logging to stderr.

Closes: #518

Implements RFD 048, separating JP's output into four distinct channels:
stdout for assistant responses, stderr for chrome (tool headers,
progress indicators), `/dev/tty` for interactive prompts, and a log file
for tracing.

`Printer` gains a `PrintTarget::Tty` variant backed by `/dev/tty` on
Unix and `CONOUT$` on Windows. A new `prompt_writer()` method routes
interactive prompts to the TTY when available, falling back to stdout.
All tool renderers, retry notifications, and reasoning progress
indicators are moved to `err_writer()`, keeping stdout clean for
assistant output that downstream consumers can pipe or capture reliably.

Tracing is now written to a log file by default and suppressed on stderr
unless explicitly requested via `-v` or `--log-file=-`. This keeps `2>
chrome.log` free of tracing noise. A new `--log-file` flag supports
directing logs to an alternate destination, with `--log-file=-`
restoring the previous behavior of logging to stderr.

Closes: #518
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 689b92c into main Apr 7, 2026
13 checks passed
@JeanMertz JeanMertz deleted the prr87 branch April 7, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFD-048: Four-Channel Output Model

1 participant