openclaw - 💡(How to fix) Fix [Bug] openclaw doctor --fix still rewrites openai-codex/* → openai/* on v2026.5.22, breaking Codex-OAuth-only compaction (re-occurrence of #78407)

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…

This is a re-occurrence of #78407 and #79461, confirmed still present on v2026.5.22.

After running openclaw doctor --fix (or after an update-triggered doctor --non-interactive --fix), all openai-codex/* model references are rewritten to openai/* with agentRuntime.id: "codex" added. For users authenticated only via OpenAI Codex OAuth (no OPENAI_API_KEY), this breaks compaction entirely:

  1. Agent chat still works — Codex OAuth intercepts those calls correctly
  2. Compaction fails — Codex native compaction cannot bind a thread, falls back to "context engine", which tries openai/gpt-5.5 directly → "No API key found for provider openai"
  3. The agentRuntime.id: "codex" workaround does not fix compaction because the Codex harness logs: "ignoring OpenClaw compaction overrides for Codex app-server compaction" then "codex app-server compaction could not use thread binding" → falls back to context engine → same failure

Root Cause

  1. Agent chat still works — Codex OAuth intercepts those calls correctly
  2. Compaction fails — Codex native compaction cannot bind a thread, falls back to "context engine", which tries openai/gpt-5.5 directly → "No API key found for provider openai"
  3. The agentRuntime.id: "codex" workaround does not fix compaction because the Codex harness logs: "ignoring OpenClaw compaction overrides for Codex app-server compaction" then "codex app-server compaction could not use thread binding" → falls back to context engine → same failure

Fix Action

Fix / Workaround

  1. Agent chat still works — Codex OAuth intercepts those calls correctly
  2. Compaction fails — Codex native compaction cannot bind a thread, falls back to "context engine", which tries openai/gpt-5.5 directly → "No API key found for provider openai"
  3. The agentRuntime.id: "codex" workaround does not fix compaction because the Codex harness logs: "ignoring OpenClaw compaction overrides for Codex app-server compaction" then "codex app-server compaction could not use thread binding" → falls back to context engine → same failure

Manual Workaround

  • openclaw doctor --fix is destructive for Codex-OAuth-only users on v2026.5.22
  • Every doctor run requires manual config repair
  • The agentRuntime.id: "codex" workaround only fixes agent chat — it does not fix compaction
  • Setting compaction.provider: "ollama" as fallback is ignored because Codex harness takes priority

Code Example

"model": { "primary": "openai-codex/gpt-5.5" }

---

"model": { "primary": "openai/gpt-5.5" },
"models": { "openai/gpt-5.5": { "agentRuntime": { "id": "codex" } } }

---

[agent/embedded] ignoring OpenClaw compaction overrides for Codex app-server compaction
[agent/embedded] codex app-server compaction could not use thread binding
[agent/embedded] native harness compaction could not use its session binding; falling back to context engine
[compaction-diag] provider=openai/gpt-5.5 outcome=failed detail=No_API_key_found_for_provider_openai

---

"model": { "primary": "openai-codex/gpt-5.5", "fallbacks": ["ollama/glm-5.1"] },
"models": { "openai-codex/gpt-5.5": {} }
RAW_BUFFERClick to expand / collapse

Summary

This is a re-occurrence of #78407 and #79461, confirmed still present on v2026.5.22.

After running openclaw doctor --fix (or after an update-triggered doctor --non-interactive --fix), all openai-codex/* model references are rewritten to openai/* with agentRuntime.id: "codex" added. For users authenticated only via OpenAI Codex OAuth (no OPENAI_API_KEY), this breaks compaction entirely:

  1. Agent chat still works — Codex OAuth intercepts those calls correctly
  2. Compaction fails — Codex native compaction cannot bind a thread, falls back to "context engine", which tries openai/gpt-5.5 directly → "No API key found for provider openai"
  3. The agentRuntime.id: "codex" workaround does not fix compaction because the Codex harness logs: "ignoring OpenClaw compaction overrides for Codex app-server compaction" then "codex app-server compaction could not use thread binding" → falls back to context engine → same failure

Environment

  • openclaw v2026.5.22 (npm global install, upgraded from v2026.5.4)
  • Ubuntu 26.04 LTS
  • Auth profiles: openai-codex:<chatgpt-account> + ollama:default. No openai:* profile.
  • No OPENAI_API_KEY

Reproduction

  1. Configure working openclaw.json with:
"model": { "primary": "openai-codex/gpt-5.5" }
  1. Run openclaw doctor --fix
  2. Doctor rewrites to:
"model": { "primary": "openai/gpt-5.5" },
"models": { "openai/gpt-5.5": { "agentRuntime": { "id": "codex" } } }
  1. Compaction triggers → fails with:
[agent/embedded] ignoring OpenClaw compaction overrides for Codex app-server compaction
[agent/embedded] codex app-server compaction could not use thread binding
[agent/embedded] native harness compaction could not use its session binding; falling back to context engine
[compaction-diag] provider=openai/gpt-5.5 outcome=failed detail=No_API_key_found_for_provider_openai
  1. Even agents.defaults.compaction.provider: "ollama" is ignored — Codex harness intercepts compaction first.

Manual Workaround

Restore openai-codex/ prefix and remove agentRuntime:

"model": { "primary": "openai-codex/gpt-5.5", "fallbacks": ["ollama/glm-5.1"] },
"models": { "openai-codex/gpt-5.5": {} }

Impact

  • openclaw doctor --fix is destructive for Codex-OAuth-only users on v2026.5.22
  • Every doctor run requires manual config repair
  • The agentRuntime.id: "codex" workaround only fixes agent chat — it does not fix compaction
  • Setting compaction.provider: "ollama" as fallback is ignored because Codex harness takes priority

Related

  • #78407 — original report (closed)
  • #79461 — v2026.5.7 re-report (closed/locked)
  • #78491 — Codex runtime model refs break auth profile selection
  • #78519 — silent billing switch from ChatGPT to OpenAI API

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