DEV Community

MilkyWay008
MilkyWay008

Posted on Originally published at github.com

Codex CLI bricks every command after an update — the wire_api config trap

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`
Enter fullscreen mode Exit fullscreen mode

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

  1. Locate the config. %USERPROFILE%\.codex\config.toml on Windows, ~/.codex/config.toml on Linux/macOS. If CODEX_HOME is set, that overrides the directory.

  2. Find the stale block. Look for [model_providers."<name>"] blocks with wire_api = "chat":

[model_providers.token-plan]
name = "token-plan"
wire_api = "chat"        # <-- this line
Enter fullscreen mode Exit fullscreen mode
  1. 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"
Enter fullscreen mode Exit fullscreen mode

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)