-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: codex exec
writes only the final message to stdout
#4644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
event: response.output_item.done | ||
data: {"type":"response.output_item.done","item":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"fixture hello"}]}} | ||
data: {"type":"response.output_item.done","item":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"model: gpt-5-high |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, not sure why that changed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think Codex was hacking this to fix the test...
} | ||
|
||
// If the user has not piped the final message to a file, they will see | ||
// it twice: once written to stderr as part of the normal event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this?
699f147
to
e180cd6
Compare
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 #1670
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 pipecodex exec
into another tool without extra filtering.I introduced
#![deny(clippy::print_stdout)]
to help enforce this change and renamed thets_println!()
macro tots_msg()
because (1) it no longer callsprintln!()
and (2),ts_eprintln!()
seemed too long of a name.While here, this also adds
-o
as an alias for--output-last-message
.Fixes #1670