Codex crashes on startup for invalid enum values in config.toml

Resolved 💬 4 comments Opened Jan 12, 2026 by yash27-lab Closed Jan 13, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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:

  1. Set model_reasoning_effort to an invalid value in ~/.codex/config.toml
  2. Run codex
  3. 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?

  1. Edit ~/.codex/config.toml
  2. Set model_reasoning_effort to an invalid value (e.g. "xhigh")
  3. Run codex
  4. 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.

View original on GitHub ↗

4 Comments

etraut-openai contributor · 7 months ago

There is no crash on startup in this case. The CLI is designed to report an error and quit if there is an invalid config key. Our philosophy is that it's better to report an error in this case rather than proceed with (potentially) incorrect configuration values.

yash27-lab · 7 months ago

Thanks for the clarification — that makes sense.

My intent was to improve DX by making the invalid-config failure more
actionable (e.g., clearly listing allowed enum values and a suggested fix),
not to proceed with potentially incorrect defaults.

On Tue, Jan 13, 2026 at 4:45 PM Eric Traut @.***> wrote:

etraut-openai left a comment (openai/codex#9104) <https://github.com/openai/codex/issues/9104#issuecomment-3746707003> There is no crash on startup in this case. The CLI is designed to report an error and quit if there is an invalid config key. Our philosophy is that it's better to report an error in this case rather than proceed with (potentially) incorrect configuration values. — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/9104#issuecomment-3746707003>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANBNCIQVZQZJYPU5U2I4T234GVRN7AVCNFSM6AAAAACROJ526GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONBWG4YDOMBQGM> . You are receiving this because you authored the thread.Message ID: @.***>
dostiharise · 6 months ago

When open my codex cli config with model_reasoning_effort to xhigh it fails to start.

According to Open AI docs the value xhigh is a valid config parameter.

$ cat ~/.codex/config.toml

model = "gpt-5.2-codex"
model_reasoning_effort = "xhigh"
etraut-openai contributor · 6 months ago

@dostiharise, this bug report is not related to the issue you're seeing. If you'd like to report a problem, please open a new issue and provide details and repro steps.