feat: allow switching approval modes when prompted to approve an edit/command

Resolved 💬 3 comments Opened Apr 19, 2025 by scottleibrand Closed Sep 3, 2025
💡 Likely answer: A maintainer (scottleibrand, contributor) responded on this thread — see the highlighted reply below.

When in suggest or auto-edit mode, codex often wants to do innocuous things that require approval, like:

╭───────────────────────────────────────────────────
│Shell Command
│
│$ nl -ba myfile.sh | sed -n '60,130p'
│
│Allow command?
│
│ ❯ Yes (y)
│ Yes, always approve this exact command for this session (a)
│ Explain this command (x)
│ Edit or give feedback (e)
│ No, and keep going (n)
╰───────────────────────────────────────────────────

In that case, I sometimes want to switch it into full-auto mode to let it do its thing. Currently, I have to cancel what it's doing and run /approve, which I don't want to do because it provides negative feedback to the model that it's on the wrong track. Instead, I'd prefer to be able to (s)witch approval mode right there in the approval prompt. Typing v should bring up the same menu as /approval:
╭───────────────────────────────────────────────────
│ Switch approval mode
│ Current mode: auto-edit
│
│
│
│ ❯ auto-edit
│ suggest
│ full-auto
│ type to search · enter to confirm · esc to cancel
╰───────────────────────────────────────────────────

View original on GitHub ↗

3 Comments

main-horse · 1 year ago

I don't understand how to exit the switcher after pressing s. Enter changes the config but does not close the menu, esc appears to do nothing.

scottleibrand contributor · 1 year ago

That is a bug that I thought codex had fixed. Will try to investigate, reliably repro, and fix today. If we are planning a release before then we can roll back this commit so it's not included until fixed.

tibo-openai collaborator · 11 months ago

Please use the latest codex-rs release

$ npm i -g @openai/codex

and visit https://openai.com/codex/ for recent updates. This should now be fixed.