Skip to content

Codex embedded agent: Cannot find module './codex-mcp-config-D66js4SP.js' on v2026.5.19 #85050

Closed as not planned

Description

@rbueno69-git

Bug Report

OpenClaw version: 2026.5.19 (a185ca2)
@openclaw/codex version: 2026.5.19
OS: Linux 6.8.0-117-generic (x64)
Node: v22.22.2

Description

Any agent configured with model codex/gpt-5.5 in agents.list[] fails immediately with:

Error: Cannot find module './codex-mcp-config-D66js4SP.js'

The file codex-mcp-config-D66js4SP.js does not exist in the installed plugin's dist/ directory — not after fresh install, not after --force reinstall, not after running postinstall-bundled-plugins.mjs.

Steps to Reproduce

  1. Add an agent to agents.list with "model": "codex/gpt-5.5"
  2. Restart gateway
  3. Send any message to that agent
  4. Error fires immediately on every request

Expected Behavior

Agent uses the Codex harness and responds via ChatGPT subscription (OAuth).

Actual Behavior

[diagnostic] lane task error: lane=session:agent:dudu:main durationMs=2601 error="Error: Cannot find module './codex-mcp-config-D66js4SP.js'"
[Embedded agent failed before reply: Cannot find module './codex-mcp-config-D66js4SP.js']

Notes

  • The Codex bot harness (@PinkRBCodexbot via native Codex channel) works fine — only embedded agent model fails
  • Running openclaw doctor --fix does not resolve
  • Reinstalling @openclaw/codex@latest --force does not resolve
  • File is simply absent from the dist/ bundle

Workaround

Set the agent model to openrouter/anthropic/claude-sonnet-4.6 — works normally but does not use the ChatGPT subscription.

Relevant log

2026-05-21T19:42:28.840+02:00 [diagnostic] lane task error: lane=session:agent:dudu:main durationMs=2561 error="Error: Cannot find module './codex-mcp-config-D66js4SP.js'
2026-05-21T19:42:28.848+02:00 Embedded agent failed before reply: Cannot find module './codex-mcp-config-D66js4SP.js'

Activity

  1. clawsweeper commented on May 21, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

    Close as duplicate: package inspection ties the reported missing codex-mcp-config-D66js4SP.js to an older 2026.5.18 hashed chunk being referenced after a 2026.5.19 package swap, and the remaining durable update/chunk-retention policy is already tracked by #85844.

    Root-cause cluster
    Relationship: duplicate
    Canonical: #85844
    Summary: The exact missing D66 chunk belongs to the prior 2026.5.18 package graph and becomes missing after a 2026.5.19 package graph is active, which is the stale hashed import/update lifecycle root cause tracked by the canonical issue.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Canonical path: Keep #85844 as the canonical fix owner for stale hashed imports, with this report linked as Codex MCP startup evidence.

    So I’m closing this here and keeping the remaining discussion on #85844.

    Review details

    Best possible solution:

    Keep #85844 as the canonical fix owner for stale hashed imports, with this report linked as Codex MCP startup evidence.

    Do we have a high-confidence way to reproduce the issue?

    Yes, we have a high-confidence source/package reproduction for the reported hash transition: openclaw@2026.5.18 imports codex-mcp-config-D66js4SP.js, while openclaw@2026.5.19 no longer ships that active import target. I did not run a live current-main gateway reproduction.

    Is this the best way to solve the issue?

    Yes, closing this as a duplicate is the best cleanup path because the remaining fix is the broader stale hashed import/update lifecycle tracked by #85844. A one-off Codex MCP alias would not solve the same failure class across package swaps.

    Security review:

    Security review: No patch or security-sensitive report was under review; this is packaging/update-lifecycle bug triage.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Current source still has a generated Codex MCP import boundary: Current main keeps loadCodexBundleMcpThreadConfig behind a dynamic import of ../agents/codex-mcp-config.js, so embedded Codex startup still depends on a generated dist chunk existing in the active package graph. (src/plugin-sdk/agent-harness-runtime.ts:245, f8675b3b70d3)
    • Current Codex startup caller reaches that boundary before reply: The Codex app-server attempt loads the bundle MCP thread config during startup before the attempt can reply, matching the reported immediate embedded-agent failure point. (extensions/codex/src/app-server/run-attempt.ts:638, f8675b3b70d3)
    • Latest release has not removed the dynamic boundary: The v2026.6.8 release source still dynamically imports ../agents/codex-mcp-config.js and still calls it from Codex startup, so the latest release does not prove this specific stale-chunk class is independently fixed. (src/plugin-sdk/agent-harness-runtime.ts:241, 844f405ac1be)
    • Package provenance for the exact missing hash: The shipped openclaw@2026.5.18 tarball includes codex-mcp-config-D66js4SP.js and its agent-harness runtime imports that name, while openclaw@2026.5.19 imports codex-mcp-config-Dglq4w-9.js instead. That makes the reported 2026.5.19 missing-D66 failure a stale old-module/new-package-tree shape.
    • Canonical related item is still open: The open canonical tracker covers old in-memory module graphs referencing removed hashed files after package updates, which is the same remaining root cause shown by the D66-to-Dgl package transition.
    • Codex dependency contract checked: Sibling Codex source confirms thread/start and thread/resume accept config overrides, and Codex config owns mcp_servers, so OpenClaw's MCP projection is a real app-server startup dependency rather than dead code. (../codex/codex-rs/app-server-protocol/src/protocol/v2/thread.rs:55, d66708232299)

    Likely related people:

    • jalehman: Introduced the Codex app-server MCP preservation path that created the codex-mcp-config projection surface involved in the stale import. (role: feature-history contributor; confidence: high; commits: 1ee0d51e92f6; files: src/agents/codex-mcp-config.ts, extensions/codex/src/app-server/thread-lifecycle.ts)
    • sercada: Recently scoped user MCP servers by agent in the same Codex MCP projection area. (role: recent Codex MCP projection contributor; confidence: medium; commits: 472523360d88; files: src/agents/codex-mcp-config.ts, src/agents/cli-runner/bundle-mcp-codex.ts)
    • vincentkoc: Recent history touches Codex app-server runtime protocol work and supervised update handoff surfaces that shape the durable stale-chunk fix. (role: recent Codex and update contributor; confidence: medium; commits: ab1e5832d2fb, fc2a7be0bc95; files: extensions/codex/src/app-server/run-attempt.ts, src/gateway/server-methods/update.ts, src/infra/update-startup.ts)
    • joshavant: Recent Linux service auto-update handoff work is relevant because the canonical fix likely lives in package update or restart policy. (role: adjacent update handoff contributor; confidence: medium; commits: 8673c65c6bad; files: src/infra/update-startup.ts)

    Codex review notes: model internal, reasoning high; reviewed against f8675b3b70d3.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    on May 21, 2026
  3. added
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jun 15, 2026
  4. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions