openclaw - 💡(How to fix) Fix [Bug]: Found a major issue with OpenClaw 2026.5.x involving native OpenAI models being forcibly routed through the Codex harness runtime.

Official PRs (…)
ON THIS PAGE

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…

Found a major issue with OpenClaw 2026.5.x involving native OpenAI models being forcibly routed through the Codex harness runtime.

Symptoms:

  • openai/gpt-4o-mini
  • openai/gpt-4o
  • openai/gpt-5

all failed with:

Requested agent harness "codex" is not registered.

even though:

  • Codex runtime was never intentionally enabled
  • agentRuntime: codex was removed from configs
  • Codex plugin/auth profiles were removed
  • normal OpenAI provider usage was intended

After tracing the runtime selection flow, the issue appears to come from:

/app/dist/policy-AKMwD9k5.js

which calls:

openAIProviderUsesCodexRuntimeByDefault(...)

That function resolves to:

/app/dist/openai-codex-routing-kS7Ub1vB.js

function openAIProviderUsesCodexRuntimeByDefault(params) {
    return isOpenAIProvider(params.provider) &&
        !openAIProviderUsesCustomBaseUrl(params.config);
}

This means:

  • ANY native openai/* provider
  • using the official OpenAI API endpoint

automatically gets forced into:

runtime: "codex"

which then crashes if the Codex harness is unavailable.

The exact runtime failure path:

throw new Error(`Requested agent harness "${runtime}" is not registered.`);

Temporary workaround that immediately restored normal OpenAI model functionality:

docker exec -it OpenClaw sh -lc 'cp /app/dist/openai-codex-routing-kS7Ub1vB.js /app/dist/openai-codex-routing-kS7Ub1vB.js.bak && sed -i "s/return isOpenAIProvider(params.provider) && !openAIProviderUsesCustomBaseUrl(params.config);/return false;/" /app/dist/openai-codex-routing-kS7Ub1vB.js'

then:

docker restart OpenClaw

After patching:

  • native OpenAI models worked normally
  • no Codex harness errors
  • standard provider runtime restored

It looks like OpenAI provider auto-routing to Codex should probably either:

  • be opt-in
  • gracefully fallback
  • or only activate when Codex is actually registered.

Error Message

throw new Error(Requested agent harness "${runtime}" is not registered.);

Root Cause

The failure occurs because OpenClaw internally resolves:

Fix Action

Fix / Workaround

Temporary workaround that immediately restored normal OpenAI model functionality:

After patching:

Normal OpenAI provider using the official OpenAI API endpoint. Codex runtime was not intentionally selected. The issue occurred after OpenAI/Codex OAuth setup had been tested, but continued even after removing Codex auth/profile references and plugin install records. The failure stopped only after patching OpenClaw’s bundled OpenAI/Codex routing logic so native OpenAI no longer defaulted to Codex runtime.

Code Example

Requested agent harness "codex" is not registered.

---

openAIProviderUsesCodexRuntimeByDefault(...)

---

function openAIProviderUsesCodexRuntimeByDefault(params) {
    return isOpenAIProvider(params.provider) &&
        !openAIProviderUsesCustomBaseUrl(params.config);
}

---

runtime: "codex"

---

throw new Error(`Requested agent harness "${runtime}" is not registered.`);

---

docker exec -it OpenClaw sh -lc 'cp /app/dist/openai-codex-routing-kS7Ub1vB.js /app/dist/openai-codex-routing-kS7Ub1vB.js.bak && sed -i "s/return isOpenAIProvider(params.provider) && !openAIProviderUsesCustomBaseUrl(params.config);/return false;/" /app/dist/openai-codex-routing-kS7Ub1vB.js'

---

docker restart OpenClaw

---

openai/gpt-4o-mini

---

Requested agent harness "codex" is not registered.

---

openAIProviderUsesCodexRuntimeByDefault(...)

---

openai/gpt-4o-mini
openai/gpt-4o
openai/gpt-5

---

Requested agent harness "codex" is not registered.

---

runtime: "codex"

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Found a major issue with OpenClaw 2026.5.x involving native OpenAI models being forcibly routed through the Codex harness runtime.

Symptoms:

  • openai/gpt-4o-mini
  • openai/gpt-4o
  • openai/gpt-5

all failed with:

Requested agent harness "codex" is not registered.

even though:

  • Codex runtime was never intentionally enabled
  • agentRuntime: codex was removed from configs
  • Codex plugin/auth profiles were removed
  • normal OpenAI provider usage was intended

After tracing the runtime selection flow, the issue appears to come from:

/app/dist/policy-AKMwD9k5.js

which calls:

openAIProviderUsesCodexRuntimeByDefault(...)

That function resolves to:

/app/dist/openai-codex-routing-kS7Ub1vB.js

function openAIProviderUsesCodexRuntimeByDefault(params) {
    return isOpenAIProvider(params.provider) &&
        !openAIProviderUsesCustomBaseUrl(params.config);
}

This means:

  • ANY native openai/* provider
  • using the official OpenAI API endpoint

automatically gets forced into:

runtime: "codex"

which then crashes if the Codex harness is unavailable.

The exact runtime failure path:

throw new Error(`Requested agent harness "${runtime}" is not registered.`);

Temporary workaround that immediately restored normal OpenAI model functionality:

docker exec -it OpenClaw sh -lc 'cp /app/dist/openai-codex-routing-kS7Ub1vB.js /app/dist/openai-codex-routing-kS7Ub1vB.js.bak && sed -i "s/return isOpenAIProvider(params.provider) && !openAIProviderUsesCustomBaseUrl(params.config);/return false;/" /app/dist/openai-codex-routing-kS7Ub1vB.js'

then:

docker restart OpenClaw

After patching:

  • native OpenAI models worked normally
  • no Codex harness errors
  • standard provider runtime restored

It looks like OpenAI provider auto-routing to Codex should probably either:

  • be opt-in
  • gracefully fallback
  • or only activate when Codex is actually registered.

Steps to reproduce

Steps to reproduce:

  1. Run OpenClaw 2026.5.x.

  2. Configure the normal native OpenAI provider with the official OpenAI API endpoint.

  3. Select a standard OpenAI model, for example:

openai/gpt-4o-mini
  1. Do not intentionally enable or configure the Codex harness runtime.

  2. Start a normal agent/session using that OpenAI model.

  3. Observe failure:

Requested agent harness "codex" is not registered.
  1. Trace shows native OpenAI provider is auto-forced into Codex runtime via:
openAIProviderUsesCodexRuntimeByDefault(...)

Expected behavior

tandard openai/* models should use the normal OpenAI provider runtime unless Codex runtime is explicitly selected.

Actual behavior

Actual behavior:

Native OpenAI models such as:

openai/gpt-4o-mini
openai/gpt-4o
openai/gpt-5

are automatically routed into the Codex harness runtime even when Codex was never explicitly enabled.

This causes sessions and embedded agents to fail with:

Requested agent harness "codex" is not registered.

The failure occurs because OpenClaw internally resolves:

runtime: "codex"

for standard OpenAI providers using the official OpenAI API endpoint.

As a result:

  • OpenAI models become unusable
  • agents fail before reply
  • fallback chains break
  • users may incorrectly assume OpenAI provider/authentication is broken

OpenClaw version

2026.5.12

Operating system

Unraid Linux

Install method

docker

Model

openai/gpt-4o-mini Also reproduced/affected with: openai/gpt-4o openai/gpt-5

Provider / routing chain

OpenClaw -> native OpenAI provider -> official OpenAI API endpoint

Additional provider/model setup details

Normal OpenAI provider using the official OpenAI API endpoint. Codex runtime was not intentionally selected. The issue occurred after OpenAI/Codex OAuth setup had been tested, but continued even after removing Codex auth/profile references and plugin install records. The failure stopped only after patching OpenClaw’s bundled OpenAI/Codex routing logic so native OpenAI no longer defaulted to Codex runtime.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

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…

FAQ

Expected behavior

tandard openai/* models should use the normal OpenAI provider runtime unless Codex runtime is explicitly selected.

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 [Bug]: Found a major issue with OpenClaw 2026.5.x involving native OpenAI models being forcibly routed through the Codex harness runtime.