If you updated Codex CLI recently and suddenly every command dies with Error loading config.toml, it's probably not your setup. One stale line in a config block you might not even use anymore is enough to brick the whole thing. I ran into this exact pattern, and here's the fix.
The symptom
Upgraded to Codex 0.151.0, then:
Error loading config.toml: `wire_api = "chat"` is no longer supported.
How to fix: set `wire_api = "responses"` in your provider config.
More info: https://github.com/openai/codex/discussions/7782
in `model_providers.token-plan.wire_api`
Every command dies at config load. codex login status dies. codex exec dies. Only codex doctor still runs, and it reports config.load: fail. If you've got a provider block in config.toml that you stopped using months ago, it still gets validated on startup, and one stale value takes everything down with it.
The root cause
Codex validates every [model_providers.*] block in config.toml at startup, not just the one you're actively using. And wire_api = "chat" was removed from the CLI entirely. Chat/completions support is gone as of early 2026. So an entry that's never referenced by your active model provider, any profile, or --model still trips the validator and kills every command.
There's no codex config migrate command, no migration path. You fix it by hand.
The fix
Locate the config.
%USERPROFILE%\.codex\config.tomlon Windows,~/.codex/config.tomlon Linux/macOS. IfCODEX_HOMEis set, that overrides the directory.Find the stale block. Look for
[model_providers."<name>"]blocks withwire_api = "chat":
[model_providers.token-plan]
name = "token-plan"
wire_api = "chat" # <-- this line
- Fix it one of two ways:
- Delete the whole block if you don't use that provider anymore, or
- Change the line to the currently valid value:
wire_api = "responses"
That's it. Flipping just that one line gets codex exec moving again. Both fixes are confirmed by people who hit this.
The lesson
When a CLI releases a version that removes a config value, check your whole config file for stale entries, not just the section you're actively using. Eager validation means an unused block can still brick startup. And if an upgrade doc says a value is deprecated, plan to remove it before you upgrade, not after the tool stops working.
Full thread: https://github.com/openai/codex/issues/41816
Top comments (0)