Codex Says the Model Is Not Supported Before It Starts
Every codex command fails before it reads your prompt. The account is fine. Your config selects a model that this installed CLI does not know how to use.
Bottom line
- Check the installed version with
codex --version. - Check user and profile configuration for a pinned model.
- Update Codex, or pass an available model with
--model. - Do not delete the full config file.
We hit this failure on July 8, 2026: an older Codex CLI loaded a newer model name from configuration and failed before task execution.
OpenAI’s current Codex configuration reference confirms that configuration sets the default model and an explicit command-line model override takes precedence. The Codex CLI guide provides the current install and update path. Both pages were checked on August 20, 2026.
The symptom
Interactive and non-interactive commands fail immediately:
codex
codex exec "summarize this repository"
The error says the selected model is unsupported or that the CLI must be upgraded. The process does not inspect files or start the task.
This is not the same failure as a stalled codex exec. A hang starts a process and waits. This error stops during configuration or model validation.
The cause
Codex can read model settings from more than one layer:
- User configuration in
~/.codex/config.toml. - A selected profile.
- Project-scoped configuration.
- An explicit command-line override.
The installed client and the selected model must agree. A configuration copied from a newer machine can select a model that an older client cannot resolve.
Diagnose without changing anything
Read the version:
codex --version
Find model pins in the user config:
rg -n '^model\s*=|^profile\s*=|^\[profiles\.' ~/.codex/config.toml
If you use profile config files, inspect the selected profile too. Do not print unrelated keys because configuration can contain endpoints or environment-variable names.
Fix option one: update Codex
Use the installation method documented for your machine. The current standalone installer uses the same command for install and update:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
Then verify the new version before retrying:
codex --version
Fix option two: override the model
If you cannot update yet, select a model that your installed client and account expose:
codex exec --model <available-model> "summarize this repository"
Do not copy a model name from an old blog post. Use a model shown by your current Codex surface or your organization’s managed model list.
The override is also a diagnostic. If the command starts with the override, the configured default caused the failure.
Make the repair durable
After the test passes, update only the stale model line in the correct config layer.
Keep sandbox, approval, MCP, and profile settings intact. Deleting the whole file can make Codex start while quietly removing important controls.
If a profile contains the model pin, changing the top-level setting will not repair that profile. Verify which profile the failing command selects.
Related Codex fixes
- codex exec Hangs Forever and Returns Nothing
- Stop Hitting Codex Usage Limits
- Is Codex Fast Mode Worth It?
Codex still fails before it reads the repo?
Book an agent rescue session. We trace the active binary, profile, and configuration layer.
Need OpenClaw fixed live?
Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.
See Rescue Session