openclaw - 💡(How to fix) Fix [Bug]: readPackageVersion fallback to 'unknown' causes feishu channel crash loop [2 comments, 3 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#72854Fetched 2026-04-28 06:31:23
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
0
Timeline (top)
commented ×2closed ×1

Error Message

Feishu channel enters a crash loop on every gateway startup. Error:

Root Cause

Traced to bundled-runtime-deps-BdEAdjwi.js:

function createRuntimeDepsCacheKey(pluginId, specs) {
    // ...
    return value.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
}

readPackageVersion() falls back to "unknown" when it fails to read the package version. This causes a cache key of openclaw-unknown-<hash>. On first startup, this directory is created but feishu's runtime deps are never installed into it — they go into the correctly-named directory instead. Subsequent starts reuse the broken openclaw-unknown-* directory.

Fix Action

Workaround

Created a symlink openclaw-unknown-ddf66de49cc0 -> openclaw-2026.4.24-b2af0de8ae3e which holds after gateway restart. Feishu channel starts successfully with this symlink in place.

Code Example

[feishu] [default] channel exited: Cannot find module '/Users/oran/.openclaw/plugin-runtime-deps/openclaw-unknown-ddf66de49cc0/dist/extensions/feishu/monitor-C_w8R_0D.js' imported from /Users/oran/.openclaw/plugin-runtime-deps/openclaw-unknown-ddf66de49cc0/dist/extensions/feishu/channel-BrSg_Wfu.js

---

function createRuntimeDepsCacheKey(pluginId, specs) {
    // ...
    return value.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
}
RAW_BUFFERClick to expand / collapse

Bug Description

Version: OpenClaw 2026.4.24 OS: macOS Darwin

Symptom

Feishu channel enters a crash loop on every gateway startup. Error:

[feishu] [default] channel exited: Cannot find module '/Users/oran/.openclaw/plugin-runtime-deps/openclaw-unknown-ddf66de49cc0/dist/extensions/feishu/monitor-C_w8R_0D.js' imported from /Users/oran/.openclaw/plugin-runtime-deps/openclaw-unknown-ddf66de49cc0/dist/extensions/feishu/channel-BrSg_Wfu.js

The directory openclaw-unknown-ddf66de49cc0 is created fresh on each gateway start, but it only contains a .openclaw-runtime-deps.json manifest and npm cache — no dist/extensions/feishu/ directory. The feishu plugin imports channel-BrSg_Wfu.js which in turn imports a sibling file monitor-C_w8R_0D.js that does not exist in that directory.

Root Cause

Traced to bundled-runtime-deps-BdEAdjwi.js:

function createRuntimeDepsCacheKey(pluginId, specs) {
    // ...
    return value.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
}

readPackageVersion() falls back to "unknown" when it fails to read the package version. This causes a cache key of openclaw-unknown-<hash>. On first startup, this directory is created but feishu's runtime deps are never installed into it — they go into the correctly-named directory instead. Subsequent starts reuse the broken openclaw-unknown-* directory.

Impact

  • Feishu channel is unavailable until manual gateway restart
  • Auto-restart attempts fail with exponential backoff (5s → 10s → 21s → 43s → 88s → 170s...)
  • System becomes unresponsive for minutes during retry backoff

Workaround

Created a symlink openclaw-unknown-ddf66de49cc0 -> openclaw-2026.4.24-b2af0de8ae3e which holds after gateway restart. Feishu channel starts successfully with this symlink in place.

Suggested Fix

  1. readPackageVersion() should not silently fall back to "unknown" — it should either throw or log a warning so the failure is visible
  2. Alternatively, when the cache key is "unknown", the bundled-runtime-deps logic should fall back to the correctly-named directory instead of creating a new broken one
  3. Add a startup validation that verifies the runtime deps directory contains the expected plugin dist/ before attempting to load

extent analysis

TL;DR

The most likely fix is to modify the readPackageVersion() function to handle version reading failures more robustly, such as throwing an error or logging a warning, to prevent the creation of a broken cache directory.

Guidance

  • Review the readPackageVersion() function to determine why it fails to read the package version and address the underlying issue.
  • Consider implementing a fallback logic in the createRuntimeDepsCacheKey function to use the correctly-named directory when the cache key is "unknown".
  • Add a validation step during gateway startup to ensure the runtime dependencies directory contains the expected plugin dist/ before attempting to load the plugins.

Example

function createRuntimeDepsCacheKey(pluginId, specs) {
    // ...
    const version = readPackageVersion();
    if (!version) {
        throw new Error("Failed to read package version");
    }
    return value.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || version;
}

Notes

The provided workaround using a symlink may not be a reliable long-term solution, as it relies on manual intervention and may not account for all possible scenarios. A more robust solution would involve addressing the root cause of the issue.

Recommendation

Apply a workaround by modifying the readPackageVersion() function to handle version reading failures more robustly, as this is the most straightforward and effective way to prevent the creation of a broken cache directory.

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 [Bug]: readPackageVersion fallback to 'unknown' causes feishu channel crash loop [2 comments, 3 participants]