codex icon indicating copy to clipboard operation
codex copied to clipboard

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

Open yash27-lab opened this issue 10 months ago • 4 comments

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.

yash27-lab avatar Jan 12 '26 17:01 yash27-lab

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.

etraut-openai avatar Jan 13 '26 21:01 etraut-openai

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: @.***>

yash27-lab avatar Jan 13 '26 22:01 yash27-lab

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"

dostiharise avatar Jan 31 '26 04:01 dostiharise

@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.

etraut-openai avatar Jan 31 '26 04:01 etraut-openai