Code formatting in "ask for approval" mode is completely broken.
Resolved 💬 6 comments Opened Aug 11, 2025 by rishsriv Closed Nov 26, 2025
💡 Likely answer: A maintainer (vmotta8, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.20.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
- Run Codex in
No, ask me to approve edits and commandsmode in any folder, using iTerm2 or the terminal app on a Mac - Ask it to implement a change to the current codebase
- The code generated is improperly formatted and impossible to read (see image). No accept/reject prompt is visible
<img width="1512" height="894" alt="Image" src="https://github.com/user-attachments/assets/e69071af-471b-4ea1-a5c9-bd2e50e82635" />
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
6 Comments
This makes read-only mode unusable in its current state.
We need a "propose patch" command that shows a diff and asks for approval.
Related:
Yup, I don't like this. This should be easy to fix, you've just got to respect newlines and common chaining operators. This could be done deterministically.
One would think @rahulrajaram, but I think we're missing a tool/command entirely. If you look at the screenshots, GPT-5 is trying to execute codex outside of the sandbox with args
--codex-run-as-apply-patch. This doesn't even feel like a valid use case for sandbox patches. There should be apropose patchtool/command that we can give permission too, orapply patchshould ask for permission in read-only sandbox (thought apply patch is missing diffs entirely).I’ve opened a PR to address this https://github.com/openai/codex/pull/4941
Awesome! Thanks @vmotta8 - I hope someone gets to it soon.
Thank you @vmotta8!