openclaw - ✅(Solved) Fix openclaw doctor fails on 2026.4.20 with missing @whiskeysockets/baileys in WhatsApp bundled runtime after successful npm rebuild [1 pull requests, 7 comments, 6 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#69842Fetched 2026-04-22 07:47:37
View on GitHub
Comments
7
Participants
6
Timeline
16
Reactions
4
Author
Timeline (top)
commented ×7cross-referenced ×4subscribed ×4closed ×1

On OpenClaw 2026.4.20, a packaged global npm install can be left with missing bundled channel runtime dependencies after the update/rebuild flow. I first hit missing grammy in the Telegram bundled runtime during openclaw update, then after stopping the gateway and running npm rebuild -g openclaw, Telegram moved past that but openclaw doctor failed on missing @whiskeysockets/baileys in the WhatsApp bundled runtime.

This looks like a broader packaged bundled-runtime repair regression rather than a WhatsApp-only issue.

Related issue for the earlier Telegram symptom:

  • #69837

Error Message

Error: Cannot find module 'grammy' Require stack: /root/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Root Cause

This may be another surface of the same packaged bundled-runtime dependency repair regression discussed in #69837, but I am opening this separately because after rebuild the failure moved from Telegram to WhatsApp, which suggests the underlying issue is broader than a single missing package.

PR fix notes

PR #70035: fix(release-check): assert bundled plugin runtime deps after packed postinstall

Description (problem / solution / changelog)

Summary

  • release-check already validates that bundled plugin runtime deps are staged in the source dist/extensions/<id>/node_modules/ via checkBundledExtensionMetadata, but runPackedBundledChannelEntrySmoke never re-validates after runPackedBundledPluginPostinstall against the installed tarball.
  • That gap is how 2026.4.21 published to npm with dist/extensions/whatsapp/node_modules/@whiskeysockets/baileys missing: the source staging passed during build, npm pack strips every node_modules/ path, and the packed postinstall silently failed to reinstall baileys. Release-check never noticed because it did not re-check the installed layout.
  • This PR re-uses the existing collectBuiltBundledPluginStagedRuntimeDependencyErrors helper, aimed at the installed packageRoot, right after the packed postinstall runs, and fails release-check if any declared runtime dep is missing from the plugin-local node_modules.

Change Type

  • Bug fix (regression guard)
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • CI/CD / infra (release-check)

Linked Issue/PR

  • Follow-up to #69842 (closed prematurely relative to npm release: v2026.4.21 was tagged ~11 minutes before the doctor-side repair commit landed, so npm still shipped the broken state)
  • Related: #68778 (deeper fragility around RC dep + postinstall hotfix; not addressed here)

Root Cause / Why release-check missed it

  • checkBundledExtensionMetadata runs collectBuiltBundledPluginStagedRuntimeDependencyErrors against the repo's own dist/extensions/. At that point the staged node_modules are present, so the check passes.
  • collectForbiddenPackPaths then strips all node_modules/ entries from npm pack output (correct, so tarballs stay small and deterministic).
  • runPackedBundledChannelEntrySmoke installs the tarball and invokes runPackedBundledPluginPostinstall to reinstall the plugin runtime deps into the installed layout. If that postinstall silently under-installs a bundled plugin's declared deps (as happened for WhatsApp + baileys in v2026.4.21), nothing downstream notices: the compiled channel entry smoke loads entry files but does not force-import the lazy runtime dep, and the completion smoke does not touch it either.
  • Net result: release-check ships a "green" tarball whose installed layout is broken for users.

What this PR changes

  • scripts/release-check.ts:
    • New exported helper collectInstalledBundledPluginRuntimeDepErrors(packageRoot) that adapts the existing collectBuiltBundledPluginStagedRuntimeDependencyErrors to the installed packageRoot/dist/extensions/ layout.
    • New internal assertInstalledBundledPluginRuntimeDepsResolved(packageRoot) that surfaces each missing dep with its owning plugin id and throws so release-check fails visibly.
    • Wired into runPackedBundledChannelEntrySmoke immediately after runPackedBundledPluginPostinstall(packageRoot).
  • test/release-check.test.ts:
    • Unit coverage for the new helper: passes when declared deps are staged under the installed plugin, and surfaces a precise error naming plugin id + missing dep when they are not.

No runtime behavior changes in any plugin, no changes to postinstall logic, no changes to tarball contents.

Regression Test Plan

  • Coverage level:
    • Unit test (new)
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient (for the underlying helper)
  • Target tests: test/release-check.test.ts ("collectInstalledBundledPluginRuntimeDepErrors") + existing test/scripts/bundled-plugin-staged-runtime-deps.test.ts (already covers the collector).
  • Scenario the test locks in:
    • A simulated installed packageRoot with a bundled plugin that declares @whiskeysockets/baileys but has no staged node_modules/@whiskeysockets/baileys/package.json under the plugin dir produces an error naming plugin whatsapp and dependency @whiskeysockets/baileys.
    • The same simulated installed layout with the dep staged returns no errors.
  • Why this is the smallest reliable guardrail: the release-check wiring is a thin shim over a helper that is already covered in isolation; the new test asserts only that the shim assembles the packageRoot -> dist/extensions path correctly and threads errors through. The full packed install + postinstall flow is exercised by runPackedBundledChannelEntrySmoke in CI and does not need a parallel unit harness.

Verification

pnpm check:changed
  [check:changed] lanes=tooling
  [check:changed] scripts/release-check.ts: tooling surface
  [check:changed] test/release-check.test.ts: root test/support surface
  [check:changed] conflict markers ... OK
  [check:changed] lint scripts ... Found 0 warnings and 0 errors.
  [check:changed] tests changed ... Test Files 1 passed (1) / Tests 28 passed (28)

User-visible / behavior changes

  • Release-check now fails when the packed + installed + postinstalled layout is missing any declared runtime dep of a bundled plugin that opted into stageRuntimeDependencies.
  • No change for users running openclaw normally. Only affects the release lane.

Out of scope

  • The deeper WhatsApp fragility (RC baileys version, postinstall-only hotfix, doctor self-heal coverage). Tracked in #68778.
  • Supply-chain lockfile coverage for bundled plugins. Tracked in #58291.
  • The actual doctor-side repair that shipped to main as f9b20c7d17 after v2026.4.21 was tagged. That change is expected to ship in the next release; this PR is an independent regression guard that would have caught the v2026.4.21 publish itself.

Changed files

  • scripts/release-check.ts (modified, +32/-1)
  • test/release-check.test.ts (modified, +65/-0)

Code Example

openclaw update

---

Error: Cannot find module 'grammy'
Require stack:
/root/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

---

openclaw gateway stop
npm rebuild -g openclaw
openclaw gateway start
openclaw doctor

---

Error: Cannot find module '@whiskeysockets/baileys'
Require stack:
/root/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/extensions/whatsapp/auth-store-DY1p5mrF.js

---

openclaw update
openclaw gateway stop
npm rebuild -g openclaw
openclaw gateway start
openclaw doctor
RAW_BUFFERClick to expand / collapse

Summary

On OpenClaw 2026.4.20, a packaged global npm install can be left with missing bundled channel runtime dependencies after the update/rebuild flow. I first hit missing grammy in the Telegram bundled runtime during openclaw update, then after stopping the gateway and running npm rebuild -g openclaw, Telegram moved past that but openclaw doctor failed on missing @whiskeysockets/baileys in the WhatsApp bundled runtime.

This looks like a broader packaged bundled-runtime repair regression rather than a WhatsApp-only issue.

Related issue for the earlier Telegram symptom:

  • #69837

Environment

  • OpenClaw: 2026.4.20 (115f05d)
  • Previous version: 2026.4.15
  • Node: v22.22.0
  • npm: 11.12.1
  • Install type: global npm install, not a git checkout
  • OS: Ubuntu Linux

Reproduction path

  1. Run:
openclaw update
  1. During the update flow, the doctor step fails with missing Telegram runtime dependency:
Error: Cannot find module 'grammy'
Require stack:
/root/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js
  1. Then try recovery:
openclaw gateway stop
npm rebuild -g openclaw
openclaw gateway start
openclaw doctor
  1. npm rebuild -g openclaw reports success, but openclaw doctor then fails on missing WhatsApp runtime dependency:
Error: Cannot find module '@whiskeysockets/baileys'
Require stack:
/root/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/extensions/whatsapp/auth-store-DY1p5mrF.js

Actual result

  • Update to 2026.4.20 completes, but bundled runtime deps are not consistently available afterwards.
  • First symptom is Telegram missing grammy.
  • After rebuild, Telegram no longer appears to be the blocker, but WhatsApp is now missing @whiskeysockets/baileys.
  • So the rebuild/update path appears to leave packaged bundled channel runtimes in a partially repaired state.

Expected result

  • openclaw update should leave bundled channel runtimes healthy on packaged installs.
  • npm rebuild -g openclaw should restore bundled plugin/channel runtime deps reliably.
  • openclaw doctor should not fail on missing bundled runtime deps immediately after a successful rebuild.

Additional evidence

Commands run in terminal:

openclaw update
openclaw gateway stop
npm rebuild -g openclaw
openclaw gateway start
openclaw doctor

Observed versions from the terminal flow:

  • OpenClaw updated from 2026.4.15 to 2026.4.20
  • Node v22.22.0

Terminal screenshots confirm:

  • grammy missing during the post-update doctor path
  • npm rebuild -g openclaw reported success
  • @whiskeysockets/baileys missing afterwards during openclaw doctor

Notes

This may be another surface of the same packaged bundled-runtime dependency repair regression discussed in #69837, but I am opening this separately because after rebuild the failure moved from Telegram to WhatsApp, which suggests the underlying issue is broader than a single missing package.

extent analysis

TL;DR

The issue can be mitigated by manually reinstalling the missing dependencies after the openclaw update and npm rebuild -g openclaw steps.

Guidance

  • Verify that the openclaw update and npm rebuild -g openclaw steps are executed successfully, and then check for any missing dependencies manually.
  • Run npm install grammy and npm install @whiskeysockets/baileys to reinstall the missing dependencies.
  • After reinstalling the dependencies, run openclaw doctor to verify that the issue is resolved.
  • If the issue persists, try checking the versions of the installed dependencies to ensure they are compatible with OpenClaw 2026.4.20.

Example

No code snippet is provided as the issue is related to dependency installation and not code-specific.

Notes

The issue may be related to a broader packaged bundled-runtime dependency repair regression, and the provided steps are a workaround to mitigate the issue. Further investigation may be required to identify the root cause.

Recommendation

Apply the workaround by manually reinstalling the missing dependencies after the openclaw update and npm rebuild -g openclaw steps, as this is a more reliable approach given the current information.

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 - ✅(Solved) Fix openclaw doctor fails on 2026.4.20 with missing @whiskeysockets/baileys in WhatsApp bundled runtime after successful npm rebuild [1 pull requests, 7 comments, 6 participants]