← All guides

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.

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

Read next

OpenClaw Keeps Using Claude Instead of Your Local Ollama Model — Fix
OpenClaw keeps calling Claude/Anthropic even though you set up Ollama? Fix the default chat model, kill env overrides, and verify with openclaw models status.
The Soldered Memory Trap: Why 'Buy Less Now, Upgrade Later' Fails on Unified-Memory AI Boxes
Macs, Strix Halo mini-PCs and the DGX Spark all solder their memory. You buy your RAM ceiling once, permanently. Worse, in 2026 vendors deleted configs mid-generation — Apple removed the 64GB Mac mini M4 Pro and the 256GB/512GB Mac Studio. The config you planned to upgrade to may not exist when you go back.
Your Local Model Says It Wrote the File — It Didn't: Fixing Tool Calling for Local LLMs (July 2026)
Local models that print tool calls as text or claim they edited a file without touching it. The five real causes — broken chat template, wrong sampler params, tiny context, undersized model, wrong harness — and the fix for each.
Your Agent Is Ignoring CLAUDE.md. Here's Where It's Reading Instead
Claude Code follows rules you never wrote and ignores the ones you did. Usually a nested CLAUDE.md in a subfolder is silently overriding your root file.