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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗