config.yaml not respected (approvalMode ignored), error spawn ENOTDIR and ENAMETOOLONG

Resolved 💬 4 comments Opened Apr 22, 2025 by lucasrod Closed Aug 7, 2025

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?

  1. Create ~/.codex/config.yaml with 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
``

  1. 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."
``

  1. Observe that Codex reports:

``
↳ model: gpt-4o
↳ approval: suggest ← should be “auto-edit”
``

  1. 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
``

  1. 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.yaml at 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_patch against pruebas/tarea1.pas, the CLI should locate that file and write the changes there, not throw ENOTDIR.

What do you see instead?

  • Config ignored: After /clear and restart, Codex still shows:

``
↳ approval: suggest
``

  • Spawn errors:
  • Error: spawn ENOTDIR when applying a small patch.
  • Error: spawn ENAMETOOLONG when attempting a larger heredoc.
  • Patch text never applied, leaving the stub implementation unchanged.

Additional information

  • ~/.codex/instructions.md and project codex.md are being loaded correctly.
  • The project path contains a space (Tarea 1), which may be contributing to ENOTDIR errors.
  • Manual invocation of patch or editing the file outside Codex works fine.
  • Using flags --approval-mode auto-edit on 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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗