config.yaml not respected (approvalMode ignored), error spawn ENOTDIR and ENAMETOOLONG
What version of Codex is running?
v0.1.2504161551
Which model were you using?
gpt-4o
What platform is your computer?
Darwin 24.4.0 arm64 arm
What steps can reproduce the bug?
- Create
~/.codex/config.yamlwith the following contents:
``yaml``
model: gpt-4o # Modelo más inteligente disponible
approvalMode: auto-edit # Requiere aprobación para cambios
fullAutoErrorMode: ask-user # Pregunta si algo falla en modo full-auto
notify: true # Enable desktop notifications for responses
- In any Git‑tracked project directory, run:
``bash``
cd ~/Repos/P1/Tarea\ 1
codex "start implementing siguienteDigito, tell me in spanish what should the function do and what strategy you will be using to implement this."
- Observe that Codex reports:
````
↳ model: gpt-4o
↳ approval: suggest ← should be “auto-edit”
- Try to apply a multi‑line patch, for example:
```bash
codex <<EOF
apply_patch "* Begin Patch
* Update File: pruebas/tarea1.pas
@@ -1,3 +1,8 @@
procedure siguienteDigito(...);
begin
- digito := num mod 10;
- num := num div 10;
end;
*** End Patch"
EOF
```
– this triggers:
``
Error: spawn ENOTDIR
- Alternatively, attempt a long
cat <<EOF > …heredoc patch and get:
````
Error: spawn ENAMETOOLONG
What is the expected behavior?
- Configuration: Codex CLI should read
~/.codex/config.yamlat startup and set:
````
approvalMode: auto‑edit
- Patch application: Codex should apply both incremental patches and larger heredoc patches without spawning into a non‑directory path or exceeding command‑line length limits.
- Working directory resolution: When running
apply_patchagainstpruebas/tarea1.pas, the CLI should locate that file and write the changes there, not throw ENOTDIR.
What do you see instead?
- Config ignored: After
/clearand restart, Codex still shows:
````
↳ approval: suggest
- Spawn errors:
Error: spawn ENOTDIRwhen applying a small patch.Error: spawn ENAMETOOLONGwhen attempting a larger heredoc.- Patch text never applied, leaving the stub implementation unchanged.
Additional information
~/.codex/instructions.mdand projectcodex.mdare being loaded correctly.- The project path contains a space (
Tarea 1), which may be contributing toENOTDIRerrors. - Manual invocation of
patchor editing the file outside Codex works fine. - Using flags
--approval-mode auto-editon the CLI invocation does work, suggesting only the config file load is broken. - Node.js version:
v23.11.0 - Codex CLI installed via
npm install -g @openai/codex
4 Comments
Pending fixes are https://github.com/openai/codex/pull/552 and https://github.com/openai/codex/pull/361
Yup. Same for me on both points. Its now at a point for me using just the cli where it wont even detect files in folder whatsoever. The rare time it does go through i get an error file too large when its only a few hundred lines long. And refuses to pull it. But then when i force it to head the lines i can get all. But then after heading the lines i say apply the patch or fix, 'cannot find/detect x.py .. '. Rip my sanity.
Here it says:
╭──────────────────────────────────────────────────────────────╮
│ localhost session: bfe8943439744db49d18d9d2e05b8169 │
│ ↳ workdir: ~/projects/Ov3rIDE-X │
│ ↳ model: gpt-4o │
│ ↳ provider: openai │
│ ↳ approval: full-edit │
╰──────────────────────────────────────────────────────────────╯
But, it doesn't "respect it" until i change approval to "full-edit" manually
Thank you for the detailed feedback! Please try again on the latest version of Codex CLI. If the issue persists, we'd appreciate it if you could contribute to the
codex-rs/implementation. You can find more information about our ongoing updates here: https://github.com/openai/codex/discussions/1174.