openclaw - 💡(How to fix) Fix doctor --fix breaks Codex model routing by rewriting openai-codex/ to openai/ (P1: causes model failover to FW-MiniMax)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

openclaw doctor --fix (v2026.5.28) treats the openai-codex provider prefix as "legacy" and rewrites all openai-codex/* model references to openai/*. This breaks routing for Codex app-server models (e.g., gpt-5.3-codex) because the openai standard API provider cannot serve them — they only exist in the Codex app-server catalog accessible via the openai-codex provider.

Root Cause

The openai provider (standard OpenAI API) and openai-codex provider (Codex app-server via OAuth) serve different model catalogs. gpt-5.3-codex, gpt-5.5-pro, etc. are only available through the Codex app-server. The openai provider has no entry for gpt-5.3-codex and its auth profile (OPENAI_API_KEY) cannot serve it.

The doctor assumes all openai-codex/* refs are "legacy" and can be safely rewritten to openai/*. This assumption is incorrect for Codex-only models.

Fix Action

Workaround

After any doctor --fix run, manually fix the primary model and all cron jobs back to openai-codex/gpt-5.3-codex, then restart the gateway. Do NOT run doctor --fix again until this bug is resolved.

Code Example

Model refs ────────────────────────────────────────────────────────╮
│                                                                       │
- Legacy `openai-codex/*` model refs should be rewritten to           │
`openai/*`.                                                         
- agents.defaults.model.primary: openai-codex/gpt-5.3-codex should    │
│    become openai/gpt-5.3-codex.                                        
- agents.defaults.models.openai-codex/gpt-5.3-codex:│    openai-codex/gpt-5.3-codex should become openai/gpt-5.3-codex.      
- ... (same for gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.5-pro)- Run `openclaw doctor --fix`: it rewrites configured model refs and  │
│    stale sessions to `openai/*`, moves Codex intent to provider/model  │
│    runtime policy, and clears old whole-agent runtime pins.            
│                                                                       │
├───────────────────────────────────────────────────────────────────────╯
RAW_BUFFERClick to expand / collapse

Bug: openclaw doctor --fix rewrites openai-codex/ model refs to openai/, breaking Codex model routing

Summary

openclaw doctor --fix (v2026.5.28) treats the openai-codex provider prefix as "legacy" and rewrites all openai-codex/* model references to openai/*. This breaks routing for Codex app-server models (e.g., gpt-5.3-codex) because the openai standard API provider cannot serve them — they only exist in the Codex app-server catalog accessible via the openai-codex provider.

Impact

  • Severity: P1 — Every doctor --fix run causes all sessions and cron jobs using gpt-5.3-codex to fail with Unknown model and fall back to FW-MiniMax-M2.5 or ollama/glm-5.1:cloud
  • Frequency: 3 occurrences in 4 days (May 28, May 30, May 31) — each triggered by a doctor --fix or gateway restart that reset the provider prefix
  • Silent failure: No warning during the rewrite that Codex models will break

Reproduction

  1. Set up OpenAI OAuth via openclaw configure (creates openai-codex auth profile)
  2. Set default model to openai-codex/gpt-5.3-codex
  3. Verify it works: sessions route correctly through Codex app-server
  4. Run openclaw doctor --fix
  5. Observe: all openai-codex/* refs are rewritten to openai/*
  6. Result: openai/gpt-5.3-codex fails because openai provider does not have gpt-5.3-codex in its catalog

Doctor Output (v2026.5.28)

◇  Model refs ────────────────────────────────────────────────────────╮
│                                                                       │
│  - Legacy `openai-codex/*` model refs should be rewritten to           │
│    `openai/*`.                                                         │
│  - agents.defaults.model.primary: openai-codex/gpt-5.3-codex should    │
│    become openai/gpt-5.3-codex.                                        │
│  - agents.defaults.models.openai-codex/gpt-5.3-codex:                  │
│    openai-codex/gpt-5.3-codex should become openai/gpt-5.3-codex.      │
│  - ... (same for gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.5-pro)         │
│  - Run `openclaw doctor --fix`: it rewrites configured model refs and  │
│    stale sessions to `openai/*`, moves Codex intent to provider/model  │
│    runtime policy, and clears old whole-agent runtime pins.            │
│                                                                       │
├───────────────────────────────────────────────────────────────────────╯

Expected Behavior

doctor --fix should NOT rewrite openai-codex/ to openai/ for models that only exist in the Codex app-server catalog. The openai-codex provider is the correct and only valid route for Codex app-server models when using OAuth authentication.

If openai-codex is being deprecated as a provider prefix, the rewrite must:

  1. Verify the target openai/ provider can actually serve the model (check catalog or auth profile)
  2. If the model is Codex-app-server-only, either keep the openai-codex/ prefix or add an agentRuntime: codex policy to the openai/ model entry so the harness knows to route through the Codex app-server

Root Cause

The openai provider (standard OpenAI API) and openai-codex provider (Codex app-server via OAuth) serve different model catalogs. gpt-5.3-codex, gpt-5.5-pro, etc. are only available through the Codex app-server. The openai provider has no entry for gpt-5.3-codex and its auth profile (OPENAI_API_KEY) cannot serve it.

The doctor assumes all openai-codex/* refs are "legacy" and can be safely rewritten to openai/*. This assumption is incorrect for Codex-only models.

Environment

  • OpenClaw version: 2026.5.28 (e932160)
  • Plugin: @openclaw/codex v2026.5.28
  • Auth: OpenAI OAuth via openclaw configure (provider: openai-codex)
  • Default model: openai-codex/gpt-5.3-codex
  • Platform: macOS (Darwin 25.5.0 arm64)
  • Codex standalone: v0.135.0 (installed at ~/.local/bin/codex)

Workaround

After any doctor --fix run, manually fix the primary model and all cron jobs back to openai-codex/gpt-5.3-codex, then restart the gateway. Do NOT run doctor --fix again until this bug is resolved.

Related

  • GH #87650 (P1, closed) — Codex provider validation mismatch (May 28 incident)
  • GH #84141 — Codex tool regression when toolsAllow is set (May 24)
  • GH #84874 — AI Exec write tool fallback

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix doctor --fix breaks Codex model routing by rewriting openai-codex/ to openai/ (P1: causes model failover to FW-MiniMax)