Codex crashes on startup for invalid enum values in config.toml
What version of Codex is running?
codex-cli 0.42.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
_No response_
What platform is your computer?
Macos
What issue are you seeing?
Codex CLI fails to start if config.toml contains an invalid enum value
(e.g. model_reasoning_effort = "xhigh").
This is a recoverable user input error and should not cause a hard startup failure.
Reproduction:
- Set model_reasoning_effort to an invalid value in ~/.codex/config.toml
- Run
codex - Codex exits with an error and does not start
Current behavior:
- Codex aborts startup with a config parsing error
Expected behavior:
- Print a clear error explaining the invalid value
- Show allowed values
- Suggest the closest valid option
- Fall back to a safe default or provide a guided fix
This would improve robustness and UX without changing defaults.
What steps can reproduce the bug?
- Edit ~/.codex/config.toml
- Set model_reasoning_effort to an invalid value (e.g. "xhigh")
- Run
codex - Codex exits with a config parsing error and does not start
What is the expected behavior?
Codex should not hard-fail on startup for an invalid enum value.
It should explain the invalid value, list allowed values, and either
fall back to a safe default or provide a guided fix.
Additional information
This failure is user-recoverable and similar errors have occurred when
config values changed between versions.
Improving error handling here would prevent startup lockouts.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗