feat: codex exec writes only the final message to stdout (#4644)
This updates `codex exec` so that, by default, most of the agent's activity is written to stderr so that only the final agent message is written to stdout. This makes it easier to pipe `codex exec` into another tool without extra filtering. I introduced `#![deny(clippy::print_stdout)]` to help enforce this change and renamed the `ts_println!()` macro to `ts_msg()` because (1) it no longer calls `println!()` and (2), `ts_eprintln!()` seemed too long of a name. While here, this also adds `-o` as an alias for `--output-last-message`. Fixes https://github.com/openai/codex/issues/1670
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
// - In the default output mode, it is paramount that the only thing written to
|
||||
// stdout is the final message (if any).
|
||||
// - In --json mode, stdout must be valid JSONL, one event per line.
|
||||
// For both modes, any other output must be written to stderr.
|
||||
#![deny(clippy::print_stdout)]
|
||||
|
||||
mod cli;
|
||||
mod event_processor;
|
||||
mod event_processor_with_human_output;
|
||||
|
||||
Reference in New Issue
Block a user