Codex: Error loading config.toml
The file is not valid TOML. The exact message, why Codex prints it, and the fix.
Updated November 23, 2026 · Checked against Codex 0.157.1, reproduced in EnvHaven 1.9.0
The message
Error loading config.toml:
~/.codex/config.toml:1:19: invalid float, expected `nan`
|
1 | approval_policy = never
| ^^^^^
What it means
The file is not valid TOML. Here the value never is unquoted, so the TOML parser reads it as a number and fails; every string value needs quotes.
Fix
- Quote string values:
approval_policy = "never"andsandbox_mode = "danger-full-access". - Check the file at the line and column in the message; the caret points at the problem.
- Run
codexagain. It refuses to start until the file parses.
In an EnvHaven workspace
Only if the file is edited by hand. The workspace writes a valid config.toml on first boot.
Where this comes from
This message was produced by Codex (Codex 0.157.1) itself, in a throwaway EnvHaven 1.9.0 container, on 2026-11-23; the text above is copied from that output.