Repository navigation
Description
- Environment
OS: macOS (Apple Silicon / m2)
Node Version: v22.22.2 (managed via fnm)
OpenClaw Version: 2026.5.2
Package Manager: npm - Problem Description
After upgrading to OpenClaw 2026.5.2, the Gateway process starts, but core functionalities (including Feishu, DingTalk, and internal dispatch/runtime) crash immediately with ERR_MODULE_NOT_FOUNDerrors.
The root cause appears to be stale hashed runtime artifacts. The running Gateway process attempts to import JavaScript files with old hash suffixes (e.g., -CtxgXAPs) that no longer exist after the upgrade overwrote the dist/directory.
- Steps to Reproduce
Ensure Node version is v22.22.2 using fnm.
Upgrade OpenClaw globally:
npm install -g openclaw@2026.5.2
Start the gateway:
openclaw start
Send a test message via Feishu or DingTalk, or observe initialization logs. - Observed Behavior & Logs (Sanitized)
The logs consistently show failures to resolve paths containing hashed filenames within the ~/.local/share/fnm/.../openclaw/dist/directory.
Example Errors:
Feishu Channel Dispatch Failure:
error gateway/channels/feishu feishu[default]: failed to dispatch message: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/[USER]/.../openclaw/dist/reply-media-paths.runtime-CtxgXAPs.js' imported from .../dist/dispatch-DGQApgF3.js
General Inbound Runtime Failure:
error channels/feishu Cannot find module '/Users/[USER]/.../openclaw/dist/inbound.runtime-By6GtcRw.js'
DingTalk SDK Dispatch Failure:
error [DingTalk:default] SDK dispatch failed: Cannot find module '/Users/[USER]/.../openclaw/dist/reply-media-paths.runtime-CtxgXAPs.js'
5. Expected Behavior
The gateway should correctly regenerate all runtime assets upon upgrade. A simple restart (openclaw start) should not result in MODULE_NOT_FOUNDerrors caused by stale file references.
- Temporary Workaround
Manually killing all Node processes and clearing runtime caches resolves the issue until the next upgrade:
pkill -f openclaw
pkill -f node
rm -rf ~/.openclaw/plugin-runtime-deps
npm uninstall -g openclaw
npm install -g openclaw@2026.5.2
openclaw start
7. Additional Context
This issue was not observed in version 2026.4.25. The problem seems related to the upgrade mechanism between 2026.4.x and 2026.5.x not properly handling the regeneration of runtime assets while the gateway is running.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 3, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main and the latest release now cover the stale live-Gateway and mixed-
distupgrade failure family well enough to close: update work is handed off outside the live Gateway, npm global updates are staged and verified before swap, and restart paths are hardened against rotated hashed chunk imports.So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the current managed update handoff and staged package-swap implementation, and ask for a new narrow report only if v2026.6.6 or newer still reproduces stale chunk imports after upgrade.
Do we have a high-confidence way to reproduce the issue?
Yes from source and field reports, but not by running a live global package upgrade in this read-only review. The stale Gateway version mismatch and missing hashed chunks match the current source comments and tests for rotated
distimports.Is this the best way to solve the issue?
Yes. The current implementation fixes the right boundary by avoiding live package-tree mutation, staging and verifying package updates, and respawning the Gateway instead of adding per-channel import fallbacks.
Security review:
Security review: No patch security review applies; this is an ordinary issue triage for update/runtime availability.
AGENTS.md: found and applied where relevant.
What I checked:
distchunk hashes after an in-place package upgrade cannot cause the scheduled update restart path to fail withERR_MODULE_NOT_FOUNDand leave the Gateway alive on old chunks. (src/cli/gateway-cli/run-loop.ts:111, 7e12a3326dd2)update.rundetects global and supervised git install surfaces and uses a managed-service handoff so the running Gateway does not replace its own package or builtdisttree while still serving RPCs. (src/gateway/server-methods/update.ts:174, 7e12a3326dd2)src/infra/package-update-steps.ts:586, 7e12a3326dd2)scripts/runtime-postbuild.mjs:28, 7e12a3326dd2)src/gateway/server-methods/update.test.ts:397, 7e12a3326dd2)distverification, and service restart behavior. Public docs:docs/install/updating.md. (docs/install/updating.md:111, 7e12a3326dd2)Likely related people:
src/gateway/server-methods/update.ts,scripts/runtime-postbuild.mjs)src/cli/gateway-cli/run-loop.ts,src/gateway/server-methods/update.ts)src/cli/gateway-cli/run-loop.ts,src/gateway/server-methods/update.ts,src/infra/package-update-steps.ts)Codex review notes: model internal, reasoning high; reviewed against 7e12a3326dd2; fix evidence: release v2026.6.6, commit 8c802aa68351.
apex-system commentedon May 11, 2026
Field update from a local macOS/Homebrew install on 2026.5.7.
Observed failure before repair:
bash-tools-BvsIc29z.js,task-registry.maintenance-CvTYvEjK.js,status.link-channel-C7zLFzlT.js, andsecrets-BXw8r2d-.js.Repair path that worked:
openclaw gateway restart --safe --jsonwas accepted, but joined an existing pending restart and did not reload the stale PID.openclaw gateway restart --force --jsonkilled the stale Gateway PID and relaunched the LaunchAgent.Post-restart proof:
openclaw gateway statusshowed a new Gateway PID listening on127.0.0.1:18789.openclaw status --jsonreported runtime/self version 2026.5.7 and no secret diagnostics.openclaw channels status --json --probereported Slackrunning: true,connected: true,healthState: healthy, and probeok: true/ HTTP 200.gateway readyandslack socket mode connected.Notes:
dist/while an old Gateway process remains alive.apex-system commentedon May 11, 2026
Follow-up from the same machine after the stale-dist restart fix.
Observed a separate failure mode from Slack after local exec tools completed successfully:
The model did not produce a response before the model idle timeout...Profile google:default timed outandembedded_run_failover_decision ... fallbackConfigured=false ... provider=google model=gemini-2.5-flash.openai/gpt-5.5as a fallback was not safe on this host because theopopenaisecret provider can time out during Gateway startup. I removed that fallback so startup is not blocked by an unavailable OpenAI secret.agents.defaults.timeoutSecondsto600as a safer host-level mitigation for the current Google primary model.Verification after restart:
channels status --probereports Slack probe HTTP 200.google/gemini-2.5-flashreturnedPONGin ~4.7s.Remaining risk:
op*) during cold startup, and those have previously timed out at 30s. That is likely a separate durability issue.IgnacioPro commentedon May 13, 2026
I hit what looks like the same stale-hash / mixed-dist family on Linux x64, but the visible symptom is Telegram
message.action=sendfailing locally before any provider call.New issue with full evidence: #81461
Key details from this repro:
openclaw --version=2026.5.3 (06d46f7)openclaw statusstill reportsGateway self ... app 2026.5.2messagetool error:Cannot find module '/usr/lib/node_modules/openclaw/dist/action-runtime-JVgOnJIQ.js' imported from /usr/lib/node_modules/openclaw/dist/probe-gofM6JmN.jsaction-runtime-CYqPrZR6.js,probe-DoAxOwuy.js)So this is not just inbound/runtime boot; it is also breaking outbound tool-driven message delivery.
barnacle-openclaw commentedon May 30, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.