openclaw - 💡(How to fix) Fix Feishu channel crashes during plugin-runtime-deps hot-rebuild: Cannot find package openclaw [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…
GitHub stats
openclaw/openclaw#70988Fetched 2026-04-24 10:37:03
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

[main] channel exited: Cannot find package 'openclaw' imported from /home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.22-4eca5026e977/dist/extensions/feishu/monitor-BPkLDEKG.js

Root Cause

  • All messages to the Feishu channel are lost/delayed during the crash window (~4 minutes in this case)
  • Users see no response from the bot
  • Auto-restart mechanism is ineffective because the module resolution error persists across restarts

Code Example

[main] channel exited: Cannot find package 'openclaw' imported from /home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.22-4eca5026e977/dist/extensions/feishu/monitor-BPkLDEKG.js

---

import { ... } from "openclaw/plugin-sdk/text-runtime";
import { ... } from "openclaw/plugin-sdk/conversation-runtime";
RAW_BUFFERClick to expand / collapse

Bug Description

When a plugin (e.g., Microsoft plugin with node-edge-tts) installs new dependencies, the plugin-runtime-deps directory gets hot-rebuilt. During this rebuild, the Feishu channel crashes repeatedly with the following error and fails to auto-recover across multiple restart attempts. Only a full Gateway restart fixes the issue.

Error Message

[main] channel exited: Cannot find package 'openclaw' imported from /home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.22-4eca5026e977/dist/extensions/feishu/monitor-BPkLDEKG.js

Reproduction Steps

  1. OpenClaw Gateway is running normally with Feishu channel connected
  2. A plugin (Microsoft) installs new runtime dependencies (node-edge-tts@^1.2.10)
  3. This triggers a plugin-runtime-deps directory rebuild
  4. During rebuild, Feishu channel crashes with the above error
  5. Feishu auto-restart attempts 5+ times, all fail
  6. Only a full systemctl --user restart openclaw-gateway recovers the channel

Timeline from Logs

TimeEvent
13:58Microsoft plugin installs node-edge-tts, triggers plugin-runtime-deps rebuild
14:00Feishu channel crashes: Cannot find package 'openclaw'
14:00-14:01Feishu auto-restart attempts 1-5/10, all fail
14:02Gateway manually restarted via systemd
14:04Feishu channel recovers, WebSocket connection successful

Technical Analysis

The monitor-*.js file in the Feishu extension imports modules like:

import { ... } from "openclaw/plugin-sdk/text-runtime";
import { ... } from "openclaw/plugin-sdk/conversation-runtime";

These resolve via a symlink in plugin-runtime-deps/node_modules/openclaw/usr/lib/node_modules/openclaw.

During the hot-rebuild:

  • The plugin-runtime-deps directory is being rewritten/replaced
  • The node_modules symlink may become temporarily invalid or point to an incompatible state
  • The Feishu channel's ESM import resolution fails during restart attempts

After restart:

  • All openclaw/plugin-sdk/* modules exist and are accessible at the target path
  • The symlink node_modules/openclaw/usr/lib/node_modules/openclaw is valid
  • Running import('openclaw/plugin-sdk/text-runtime') from the feishu extension directory succeeds

Suggested Fix

  1. Atomic swap: Rebuild plugin-runtime-deps into a temporary directory, then atomically swap (rename) to avoid partial states
  2. Graceful channel shutdown: Before starting a rebuild, signal dependent channels to pause, then restart them after the rebuild completes
  3. Rebuild isolation: Ensure the node_modules symlink remains valid throughout the rebuild process

Environment

  • OpenClaw: 2026.4.22 (00bd2cf)
  • Node.js: v22.22.2
  • OS: Linux 6.17.0-22-generic (x64)
  • Channel: Feishu (WebSocket mode)
  • plugin-runtime-deps directory: openclaw-2026.4.22-4eca5026e977

Impact

  • All messages to the Feishu channel are lost/delayed during the crash window (~4 minutes in this case)
  • Users see no response from the bot
  • Auto-restart mechanism is ineffective because the module resolution error persists across restarts

This is a reliability issue that affects any plugin that triggers plugin-runtime-deps rebuild while channels are active.

extent analysis

TL;DR

Implement an atomic swap of the plugin-runtime-deps directory to prevent partial states during rebuilds.

Guidance

  • Verify that the node_modules symlink remains valid throughout the rebuild process to prevent import resolution failures.
  • Consider implementing a graceful channel shutdown mechanism to pause dependent channels before starting a rebuild and restart them after completion.
  • Ensure that the rebuild process does not interfere with the Feishu channel's WebSocket connection to prevent crashes and auto-restart failures.
  • Review the plugin installation process to identify potential optimizations that can reduce the frequency or impact of plugin-runtime-deps rebuilds.

Example

No code snippet is provided as the issue is more related to the rebuild process and directory management rather than a specific code fix.

Notes

The suggested fixes (atomic swap, graceful channel shutdown, rebuild isolation) aim to address the root cause of the issue, which is the temporary invalidation of the node_modules symlink during the rebuild process. However, the effectiveness of these fixes may depend on the specific implementation details of the OpenClaw Gateway and plugin architecture.

Recommendation

Apply the workaround of implementing an atomic swap of the plugin-runtime-deps directory to prevent partial states during rebuilds, as this directly addresses the identified root cause of the issue.

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…

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 Feishu channel crashes during plugin-runtime-deps hot-rebuild: Cannot find package openclaw [1 participants]