openclaw - 💡(How to fix) Fix [Bug]: 2026.4.21 upgrade leaves gateway in restart loop — feishu/telegram SDK deps never auto-install because config validation fails first [1 comments, 2 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#70671Fetched 2026-04-24 05:54:53
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

After upgrading from 2026.4.15 to 2026.4.21 via npm install -g [email protected], the gateway cannot start. systemd restarts it every ~25s in a loop. Root cause is a chicken-and-egg between config validation and the plugin runtime-dep auto-installer: validation fails on missing modules before the auto-installer gets a chance to install them.

Error Message

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: Error: Cannot find module '@larksuiteoapi/node-sdk'
Require stack:
- <npm-global>/lib/node_modules/openclaw/dist/extensions/feishu/client-yWGpoGkZ.js
Run: openclaw doctor --fix
Gateway aborted: config is invalid.

Root Cause

After upgrading from 2026.4.15 to 2026.4.21 via npm install -g [email protected], the gateway cannot start. systemd restarts it every ~25s in a loop. Root cause is a chicken-and-egg between config validation and the plugin runtime-dep auto-installer: validation fails on missing modules before the auto-installer gets a chance to install them.

Fix Action

Workaround

Install the two SDKs manually into openclaw's own node_modules:

cd $(npm root -g)/openclaw
npm install --no-save --legacy-peer-deps @larksuiteoapi/node-sdk grammy
sudo systemctl restart openclaw-gateway.service

After this, startup proceeds normally; gateway then auto-installs additional runtime deps (@grammyjs/runner, @grammyjs/transformer-throttler) on its own, and logs ready (3 plugins: feishu, openclaw-weixin, telegram).

--legacy-peer-deps is needed because madge@^8.0.0 (a devDep in openclaw) conflicts with the subtree.

Code Example

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: Error: Cannot find module '@larksuiteoapi/node-sdk'
Require stack:
- <npm-global>/lib/node_modules/openclaw/dist/extensions/feishu/client-yWGpoGkZ.js
Run: openclaw doctor --fix
Gateway aborted: config is invalid.

---

Health check failed: Cannot find module 'grammy'
Require stack: - <npm-global>/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

---

cd $(npm root -g)/openclaw
npm install --no-save --legacy-peer-deps @larksuiteoapi/node-sdk grammy
sudo systemctl restart openclaw-gateway.service
RAW_BUFFERClick to expand / collapse

Summary

After upgrading from 2026.4.15 to 2026.4.21 via npm install -g [email protected], the gateway cannot start. systemd restarts it every ~25s in a loop. Root cause is a chicken-and-egg between config validation and the plugin runtime-dep auto-installer: validation fails on missing modules before the auto-installer gets a chance to install them.

Environment

  • Host: Linux 6.12.18 (x86_64)
  • Node: 22.22.0
  • Install: npm install -g [email protected] (clean upgrade from 2026.4.15)
  • Service runner: openclaw-gateway.service (systemd)
  • Config: channels.feishu + channels.telegram both enabled in openclaw.json
  • Previous 4.15 install: working, @larksuiteoapi/node-sdk and grammy were present in node_modules

Reproduction

  1. Have a working 2026.4.15 install with Feishu and/or Telegram channels enabled in openclaw.json.
  2. npm install -g [email protected] — npm reports added 18 packages, removed 462 packages, and changed 439 packages. (Note the 462 removals — this is where the SDKs get dropped.)
  3. Restart the gateway: sudo systemctl restart openclaw-gateway.service.
  4. Gateway fails to start. systemd relaunches every ~25s.

Observed behavior

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: Error: Cannot find module '@larksuiteoapi/node-sdk'
Require stack:
- <npm-global>/lib/node_modules/openclaw/dist/extensions/feishu/client-yWGpoGkZ.js
Run: openclaw doctor --fix
Gateway aborted: config is invalid.

Same happens for grammy (Telegram extension) — only visible once Feishu is fixed:

Health check failed: Cannot find module 'grammy'
Require stack: - <npm-global>/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

openclaw doctor / openclaw doctor --fix does not fix this. It successfully installs other bundled plugin deps (acpx, node-edge-tts, playwright-core) but Feishu and Telegram are skipped — I believe because the config validation errors out before the doctor is able to register Feishu/Telegram as active plugins needing deps.

Root cause (my reading)

  • @larksuiteoapi/node-sdk and grammy are not listed in openclaw's package.json#dependencies in 2026.4.21. They are treated as runtime deps to be auto-installed on demand, like node-edge-tts.
  • dist/extensions/feishu/client-*.js does an eager require('@larksuiteoapi/node-sdk') at load time.
  • Config resolution imports those extensions (or their schemas/clients) as part of validating channels.feishu / channels.telegram.
  • If the module isn't installed yet, require throws → config validation fails → gateway refuses to start → the auto-installer never runs → we loop.

Workaround

Install the two SDKs manually into openclaw's own node_modules:

cd $(npm root -g)/openclaw
npm install --no-save --legacy-peer-deps @larksuiteoapi/node-sdk grammy
sudo systemctl restart openclaw-gateway.service

After this, startup proceeds normally; gateway then auto-installs additional runtime deps (@grammyjs/runner, @grammyjs/transformer-throttler) on its own, and logs ready (3 plugins: feishu, openclaw-weixin, telegram).

--legacy-peer-deps is needed because madge@^8.0.0 (a devDep in openclaw) conflicts with the subtree.

Suggested fixes (pick whichever matches the project's direction)

  1. Make the deps lazy: defer require('@larksuiteoapi/node-sdk') / require('grammy') until channel start, not config parse. Config validation should be static/schema-only. If the channel is later started and the dep is missing, emit a clean error and invoke the auto-installer. This breaks the chicken-and-egg cleanly.
  2. Auto-install before validation: detect missing runtime deps for enabled-in-config plugins before running validateConfig, install them synchronously, then validate. (Similar to how acpx etc. are handled today, but needs to run before config parse rather than after.)
  3. Declare them as optionalDependencies: pins them so npm install -g openclaw always installs them when the host supports it, same as most Node libraries do with platform-native addons.
  4. Short term / docs: release notes for 2026.4.x should flag the expected 462 packages removed line and include the manual-install workaround.

Severity

High — silent breakage on a routine npm install -g upgrade. Any user with Feishu or Telegram channels enabled hits this. The CLI's own doctor command does not self-heal. My gateway was stuck restarting in a loop with all 6 Feishu bots and 5 Telegram bots offline until I manually installed the SDKs.

Related

  • Possibly linked to the dependency-tree refactor in 2026.4.21 ("Plugin dependency repairs for packaged installs" in the changelog).

extent analysis

TL;DR

Manually installing the required SDKs (@larksuiteoapi/node-sdk and grammy) in the openclaw directory resolves the issue.

Guidance

  • The root cause is a chicken-and-egg problem between config validation and the plugin runtime dependency auto-installer, where validation fails due to missing modules before the auto-installer can install them.
  • To verify the issue, check the systemd logs for the openclaw-gateway service, which should show a loop of restarts every ~25s.
  • To mitigate the issue, manually install the required SDKs using the provided workaround: cd $(npm root -g)/openclaw and npm install --no-save --legacy-peer-deps @larksuiteoapi/node-sdk grammy.
  • After manual installation, the gateway should start normally and auto-install additional runtime dependencies.

Example

The manual installation command is:

cd $(npm root -g)/openclaw
npm install --no-save --legacy-peer-deps @larksuiteoapi/node-sdk grammy

Followed by a restart of the openclaw-gateway service:

sudo systemctl restart openclaw-gateway.service

Notes

The provided workaround is a temporary solution until a more permanent fix is implemented, such as making the dependencies lazy or auto-installing them before validation.

Recommendation

Apply the workaround by manually installing the required SDKs, as it is a straightforward and effective solution to resolve the issue. This will allow the gateway to start and function normally until a more permanent fix is implemented.

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]: 2026.4.21 upgrade leaves gateway in restart loop — feishu/telegram SDK deps never auto-install because config validation fails first [1 comments, 2 participants]