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?

  1. Run Codex in No, ask me to approve edits and commands mode in any folder, using iTerm2 or the terminal app on a Mac
  2. Ask it to implement a change to the current codebase
  3. 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_

View original on GitHub ↗

6 Comments

nestedlogicsol · 1 year ago

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:

rahulrajaram · 1 year ago

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.

nestedlogicsol · 1 year ago

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 a propose patch tool/command that we can give permission too, or apply patch should ask for permission in read-only sandbox (thought apply patch is missing diffs entirely).

vmotta8 contributor · 1 year ago

I’ve opened a PR to address this https://github.com/openai/codex/pull/4941

nestedlogicsol · 1 year ago

Awesome! Thanks @vmotta8 - I hope someone gets to it soon.

rishsriv · 1 year ago

Thank you @vmotta8!