Repository navigation
Description
Bug type
Regression (worked before, now fails)
Summary
After updating to OpenClaw 2026.7.1, switching to OpenAI GPT models (via ChatGPT OAuth) in the webchat GUI fails with:
The Codex plugin (@openclaw/codex@2026.7.1) imports formatToolExecutionErrorMessage from openclaw/plugin-sdk/agent-harness-runtime. However, multiple bundled instances of agent-harness-runtime.js in the Gateway and Email plugin do not export this function — only the Codex plugin's own bundled openclaw copy does. Node.js module resolution can resolve the import to any of these instances, causing inconsistent failures.
Steps to reproduce
- Install OpenClaw 2026.7.1 (npm, Docker)
- Authenticate with OpenAI via OAuth:
openclaw models auth login --provider openai - Open webchat GUI, switch model to
openai/gpt-5.5 - Send a message
- Error: "The requested module 'openclaw/plugin-sdk/agent-harness-runtime' does not provide an export named 'formatToolExecutionErrorMessage'"
Expected behavior
GPT models work after OAuth login without module export errors.
Actual behavior
Agent fails before reply. The function formatToolExecutionErrorMessage exists in tool-result-error-*.js and is exported by the Codex plugin's bundled openclaw copy, but is missing from at least 3 other agent-harness-runtime.js instances:
/app/dist/plugin-sdk/agent-harness-runtime.js(Gateway)~/.openclaw/extensions/email/node_modules/openclaw/dist/plugin-sdk/agent-harness-runtime.js(Email plugin)~/.openclaw/extensions/email/node_modules/.openclaw-80GR2TWS/dist/plugin-sdk/agent-harness-runtime.js(Email plugin alias)
Root cause: Build pipeline sync issue — the @openclaw/codex@2026.7.1 plugin was compiled against a newer openclaw SDK build that exports formatToolExecutionErrorMessage, but the Gateway and Email plugin bundles ship an older build without the export. When Node.js resolves openclaw/plugin-sdk/agent-harness-runtime from the Codex plugin, it can resolve to any of the older instances depending on module resolution order.
Workaround: Manually add the function definition and export to all instances of agent-harness-runtime.js:
function formatToolExecutionErrorMessage(error, fallback) {
try {
return formatErrorMessage(error) || fallback;
} catch {
return fallback;
}
}And add formatToolExecutionErrorMessage to the export statement. After patching all 4 instances and restarting the gateway, GPT models work correctly.
OpenClaw version
2026.7.1
Operating system
Linux (Docker container, Ubuntu 26.04 host)
Install method
npm (Docker)
Model
openai/gpt-5.5 (via ChatGPT OAuth)
Provider / routing chain
openai (ChatGPT OAuth)
Additional provider/model setup details
OAuth login via openclaw models auth login --provider openai --device-code
Logs
Error message: The requested module 'openclaw/plugin-sdk/agent-harness-runtime' does not provide an export named 'formatToolExecutionErrorMessage'
Impact and severity
Blocks all OpenAI GPT model usage via OAuth. Other providers (Ollama Cloud, Comet) work fine.
Additional information
openclaw update statusreports "up to date" on 2026.7.1- 4 total instances of
agent-harness-runtime.jsfound on the system; 3 were missing the export - Patching all instances + gateway restart resolves the issue
- Related: [Bug]: Gateway refuses readiness after 2026.7.1 update due to plugin install metadata conflict for codex/discord #107727 (plugin install metadata conflict), [Bug]: 2026.7.1Agent failed before reply: LLM request failed: provider rejected the request schema or tool payload. Logs: openclaw logs --follow #108075 (agent failed before reply)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
NianJiuZst commentedon Jul 16, 2026
I checked the shipped artifacts directly. My current conclusion is that the reported import error is plausible, but the proposed root cause ("the official 2026.7.1 Gateway/npm/Docker build is missing the export and Node randomly selects another copy") is not supported by the published artifacts.
Evidence checked on 2026-07-16:
openclaw@2026.7.1npm tarball (SHA-25667ad539d9915efb63d5f294beeb9290b7172d23c92d8052110a9c8355f783458) imports and exportsformatToolExecutionErrorMessagefromdist/plugin-sdk/agent-harness-runtime.js.@openclaw/codex@2026.7.1tarball (SHA-2567909c0de5c79c3b00dac6f99a6f0f866424c719818b48da19b55b75efd6d157d) imports that same SDK export.openclaw:2026.7.1architectures, amd64 and arm64, identify revision2d2ddc43d0dcf71f31283d780f9fe9ff4cc04fe4and contain the export in/app/dist/plugin-sdk/agent-harness-runtime.js.f53346944db01a57e0522d494c4e15f281201c7din feat: correlate native search outcomes in audit history #98704 on 2026-07-06, and that commit is an ancestor of the v2026.7.1 release commit.parentURL; it does not randomly select a sibling package copy. OpenClaw 2026.7.1 also installs a scoped native Plugin SDK resolver and links pluginopenclawpeer dependencies back to the host package.@clawemail/email@0.9.13is a third-party package with anopenclaw >=2026.3.22peer dependency. Its published tarball does not bundle an OpenClaw package. Nested OpenClaw copies under that installation therefore point to installation/peer-link state, not an official Email plugin bundle.There is, however, a plausible mixed-version failure mode: I also checked
openclaw@2026.7.1-beta.2, and that older package does not export this helper. If the stable Codex plugin resolves an older retained SDK copy, the exact named-export error would be expected. That would make this an install-tree/peer-link/resolver consistency issue rather than a missing export in the stable release.To distinguish a real loader bug from stale installation state, could you provide:
openclaw/plugin-sdk/agent-harness-runtimepath from the failing Codex importer.node_modules/openclawsymlink/peer link.openclaw plugins inspect codex --runtime --json.Manually patching every copy can mask the resolution problem, so I would avoid treating that as the product fix. If the evidence above shows that the 2026.7.1 host resolver is selecting an older nested copy, that would be a concrete loader/repair bug to fix. I did not reproduce the reporter's exact persisted installation and OAuth state; the conclusion above is specifically about the published package/image claim and the module-resolution boundary.
clawsweeper commentedon Jul 31, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 31, 2026, 9:28 AM ET / 13:28 UTC.
Summary
Keep this issue open: the reported named-export failure remains plausible for a mixed or stale managed-plugin install, but the supplied artifact review shows that the official
v2026.7.1core package and images already export the helper, so the stated “random bundled-copy selection” root cause is not established. The next useful step is to capture the Codex importer’s resolved SDK path and peer link, then confirm whether current repair logic corrects that installation state.Reproducibility: no. high-confidence current-main reproduction is available. The published 2026.7.1 artifacts reportedly contain the export, but the exact named-export error remains source-plausible if Codex resolves a retained incompatible peer dependency; the resolved importer path and link target are still needed.
Ways to help us reproduce this
Next step
Do not dispatch a repair PR until the failing Codex importer path and peer-link state distinguish an unresolved resolver defect from a repaired stale installation.
Review details
Best possible solution:
Make the managed-plugin resolver bind Codex to the current host SDK, add a focused mixed-version/retained-peer-link regression test if that path is not already covered, and provide a supported doctor repair rather than editing generated distribution files.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction is available. The published 2026.7.1 artifacts reportedly contain the export, but the exact named-export error remains source-plausible if Codex resolves a retained incompatible peer dependency; the resolved importer path and link target are still needed.
Is this the best way to solve the issue?
No: patching every installed runtime copy is not the best fix because it masks the actual dependency-resolution boundary. A host-peer-link or managed-plugin repair, backed by a mixed-version regression test and a supported doctor path, is the narrower durable solution.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against aaab981ab097.
Label changes
Label changes:
P1: The reported failure prevents a normal OpenAI OAuth-backed agent turn from producing any reply after an update.impact:auth-provider: The failing path is the OpenAI/Codex provider runtime reached after ChatGPT OAuth authentication.impact:ux-friction: The only reported workaround is invasive manual patching of installed generated files, creating substantial recovery burden.issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.Label justifications:
P1: The reported failure prevents a normal OpenAI OAuth-backed agent turn from producing any reply after an update.impact:auth-provider: The failing path is the OpenAI/Codex provider runtime reached after ChatGPT OAuth authentication.impact:ux-friction: The only reported workaround is invasive manual patching of installed generated files, creating substantial recovery burden.Evidence reviewed
What I checked:
openclaw@2026.7.1tarball and both official 2026.7.1 container architectures exportformatToolExecutionErrorMessage; this weakens the claim that the stable host artifact itself omitted the export, while leaving a mixed installed tree plausible. (2d2ddc43d0dc)src/plugin-sdk/agent-harness-runtime.ts, f53346944db0)openclawpeer-link target, andopenclaw plugins inspect codex --runtime --jsonoutput.Likely related people:
f53346944db01a57e0522d494c4e15f281201c7d. (role: feature introducer and recent SDK-area contributor; confidence: medium; commits: f53346944db0; files:src/plugin-sdk/agent-harness-runtime.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.