bug: quiet mode still printing json formatted text to terminal

Resolved 💬 7 comments Opened Apr 23, 2025 by Stewart86 Closed Aug 7, 2025
💡 Likely answer: A maintainer (LuciNyan, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

v0.1.2504221401

Which model were you using?

o4-mini

What platform is your computer?

Linux 6.14.3-arch1-1 x86_64 unknown

What steps can reproduce the bug?

when using codex -q "explain this project.." I am still seeing JSON output.

What is the expected behavior?

Should only return final result from assistant. nothing else, unless it is stderr.

What do you see instead?

I am seeing the JSON output of the reasoning, function calls etc.

Additional information

!Image

View original on GitHub ↗

7 Comments

LuciNyan contributor · 1 year ago

The console.log in onItem within runQuietMode seems intentional but unclear. Looking forward to understanding the intended logging design and happy to implement any suggested improvements.

Stewart86 · 1 year ago

Yeah, I saw the code too. but if we are to use Codex in a shell environment where we pipe the response to other command / process, console.log which is still stdout, I supposed, will be piped into the next command, which just defeats the purpose.

edit: well, I guess maybe there can be use cases where we want to examine the the entire reasoning steps and process (what has been done etc.). But most often than not, if we are running on quiet mode, I supposed, we should only be expecting the final "summarized" output? Perhaps what we need to additional prompt to make sure AI summarize the final response instead of vomiting out everything?

moppywhip contributor · 1 year ago

@Stewart86 yeah I think that makes a lot of sense.
re: @LuciNyan
I'm also very confused about this bit. There's a comment in cli.tsx suggesting that the output of quiet mode should only be the final message

It seems like the onItem/runQuietMode logic and this comment were both committed in the initial commit from OpenAI. Not sure what the plan is here.

agustif · 1 year ago

This is still broken, kinda confusing that in the cli reference there's an example using both quiet and json flag...

!Image

Riofd · 1 year ago

The quiet mode can't output the same results as the non-quiet mode. For quiet mode, codex only outputs the ls command results when using the example query explain this codebase to me.

rajohns08 · 1 year ago

Any updates? Is there a plan to output only the final answer? That would make this more useful for combining with other agents/tools.

codex-maintainers · 11 months ago

Thank you for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, we would be happy to take a look at it in the codex-rs/ implementation. For more details, please refer to our project update: https://github.com/openai/codex/discussions/1174.