Skip to content

[Bug]: doctor --fix rewrites Codex runtime model refs to openai/* and breaks Codex auth profile selection #78499

@rodrigolourencofarinha

Description

@rodrigolourencofarinha

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After openclaw doctor --fix on OpenClaw 2026.5.5, agents using agentRuntime.id: "codex" were configured with openai/gpt-5.5, and Telegram turns failed because the Codex app-server tried to use openai:default instead of an openai-codex auth profile.

Steps to reproduce

  1. Use OpenClaw 2026.5.5 with @openclaw/codex installed/enabled and agents using agentRuntime.id: "codex".
  2. Run openclaw doctor --fix.
  3. Restart the gateway.
  4. Send /new to a Telegram bot account.
  5. Send a normal Telegram message to the same bot.

Expected behavior

A normal Telegram message after /new should complete an agent turn. This was observed after manually setting agents back to codex/gpt-5.5: the Claw Telegram session returned "OpenClaw repair OK" with deliverySucceeded: true, and an agent probe returned "OK" through provider codex, model gpt-5.5, agentHarnessId codex.

Actual behavior

/new succeeded, but normal Telegram messages failed with:

Something went wrong while processing your request. Please try again, or use /new to start a fresh session.

Gateway logs showed:

2026-05-06T10:22:27.131-03:00 [agents/harness] Codex agent harness failed; not falling back to embedded PI backend
2026-05-06T10:22:27.132-03:00 [diagnostic] lane task error: lane=main durationMs=1175 error="Error: Codex app-server auth profile "openai:default" must belong to provider "openai-codex" or a supported alias."

The same error was observed for another agent Telegram session at 10:22:28.

OpenClaw version

OpenClaw 2026.5.5 (b1abf9d); @openclaw/codex 2026.5.5 after plugin repair

Operating system

macOS 26.4.1 arm64; Node 25.9.0

Install method

LaunchAgent: /opt/homebrew/opt/node/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789

Model

Failing path: openai/gpt-5.5 with agentRuntime.id "codex". Working workaround: codex/gpt-5.5 with agentRuntime.id "codex".

Provider / routing chain

Telegram DM -> local OpenClaw gateway 127.0.0.1:18789 -> configured agent -> agentRuntime.id "codex" -> Codex app-server harness. Failing auth selection: openai:default.

Additional provider/model setup details

Auth profiles present, redacted:

  • anthropic:default -> provider anthropic
  • openai-codex: -> provider openai-codex, mode oauth
  • openai:default -> provider openai, mode api_key

After the failure, all ten agents had model.primary "openai/gpt-5.5" with agentRuntime.id "codex".

Manual workaround applied:

  • agents.defaults.model.primary = codex/gpt-5.5
  • agents.list[*].model.primary = codex/gpt-5.5
  • plugins.entries.memory-core.* execution model refs = codex/gpt-5.5

Logs, screenshots, and evidence

openclaw doctor after the manual workaround still proposed migrating working codex/gpt-5.5 refs:

Moved agents.defaults.model legacy runtime primary refs to canonical provider refs and selected codex runtime.
Moved agents.defaults.models legacy runtime keys to canonical provider keys.
Moved agents.list.main.model legacy runtime primary refs to canonical provider refs and selected codex runtime.
Run "openclaw doctor --fix" to apply these changes.

Installed OpenClaw migration code maps legacy provider codex to provider openai with runtime codex:

{
  legacyProvider: "codex",
  provider: "openai",
  runtime: "codex",
  cli: false
}

Installed @openclaw/codex 2026.5.5 code uses:
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex"]);
const CODEX_PROVIDER_ID = "codex";

Verification after workaround:
- Claw Telegram session: status ok, finalAssistantVisibleText "OpenClaw repair OK", deliverySucceeded true, provider codex, model gpt-5.5, agentHarnessId codex.
- Murphy probe: status ok, finalAssistantVisibleText "OK", provider codex, model gpt-5.5, agentHarnessId codex.
- openclaw status --deep: Telegram OK, 10/10 accounts, 0 active tasks, event loop OK.

Impact and severity

Affected users/systems/channels: observed on Telegram DM sessions for default Claw and Murphy; config showed the same openai/gpt-5.5 + agentRuntime.id "codex" pairing for all ten configured agents.
Severity: blocks Telegram agent replies.
Frequency: observed on normal Telegram messages after /new at 10:22 and 10:23 on 2026-05-06.
Consequence: Telegram users receive the generic failure reply instead of an agent response.

Additional information

Before this issue was isolated, a stale Codex plugin install was also observed: host OpenClaw was 2026.5.5, installed @openclaw/codex was 2026.5.3, and openclaw plugins update codex reported it was up to date. For this report, the auth-profile failure above was verified after installing @openclaw/codex@2026.5.5 and disabling a separate active-memory timeout, so the remaining grounded failure was the model/provider migration mismatch.

Generic API-created issue with the same evidence: #78491. This form-backed draft supersedes it if filed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions