feat: allow switching approval modes when prompted to approve an edit/command
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
╰───────────────────────────────────────────────────
3 Comments
I don't understand how to exit the switcher after pressing
s.Enterchanges the config but does not close the menu,escappears to do nothing.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.
Please use the latest codex-rs release
and visit https://openai.com/codex/ for recent updates. This should now be fixed.