openclaw - ✅(Solved) Fix [Bug]: Error: Cannot find module 'grammy' [3 pull requests, 6 comments, 7 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#69831Fetched 2026-04-22 07:47:46
View on GitHub
Comments
6
Participants
7
Timeline
12
Reactions
9
Author
Timeline (top)
commented ×6labeled ×2subscribed ×2closed ×1

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Update Result: ERROR Root: /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw Reason: openclaw doctor Before: 2026.4.20 After: 2026.4.20

Error Message

Error: Cannot find module 'grammy' Update Result: ERROR Error: Cannot find module 'grammy' Error: Cannot find module 'grammy' Error: Cannot find module 'grammy'

Root Cause

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Update Result: ERROR Root: /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw Reason: openclaw doctor Before: 2026.4.20 After: 2026.4.20

PR fix notes

PR #70091: fix(telegram): align grammy version spec to match installed version (#69831)

Description (problem / solution / changelog)

Fixes #69831 — grammy declared as ^1.42.0 but installed version is 1.41.1. The runtime dep staging script skips deps when installed version doesn't satisfy the semver spec, causing Cannot find module 'grammy' at runtime.

Root cause: The staging script in stage-bundled-plugin-runtime-deps.mjs uses dependencyVersionSatisfied(spec, installedVersion) to validate before staging. Since ^1.42.0 is not satisfied by 1.41.1, grammy was never staged into dist/extensions/telegram/node_modules/.

Fix: Change grammy: '^1.42.0'grammy: '^1.41.0' to match the installed version.

Changed files

  • extensions/browser/src/browser/pw-session.test.ts (modified, +75/-0)
  • extensions/browser/src/browser/pw-session.ts (modified, +65/-0)
  • extensions/browser/src/browser/pw-tools-core.browser-ssrf-guard.test.ts (modified, +1/-0)
  • extensions/browser/src/browser/pw-tools-core.snapshot.ts (modified, +10/-1)
  • extensions/telegram/package.json (modified, +1/-1)
  • extensions/telegram/src/bot-message-context.body.ts (modified, +10/-1)
  • extensions/whatsapp/src/auto-reply.web-auto-reply.last-route.test.ts (modified, +109/-0)
  • extensions/whatsapp/src/auto-reply/monitor/on-message.ts (modified, +6/-0)
  • src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.custom-provider-payloads.test.ts (added, +113/-0)
  • src/agents/pi-embedded-subscribe.ts (modified, +5/-3)
  • src/agents/sandbox/remote-fs-bridge.test.ts (modified, +57/-0)
  • src/agents/sandbox/remote-fs-bridge.ts (modified, +16/-2)
  • src/infra/system-events.test.ts (modified, +31/-0)
  • src/infra/system-events.ts (modified, +6/-1)
  • src/plugins/bundled-capability-runtime.ts (modified, +1/-1)
  • src/plugins/bundled-channel-config-metadata.ts (modified, +1/-1)
  • src/plugins/loader.ts (modified, +1/-1)
  • src/plugins/public-surface-loader.ts (modified, +2/-2)
  • src/plugins/source-loader.ts (modified, +1/-1)
  • src/tasks/task-registry.audit.test.ts (modified, +77/-0)
  • src/tasks/task-registry.ts (modified, +7/-4)

PR #69893: fix: multiple bundled plugin and channel regression fixes

Description (problem / solution / changelog)

Multiple regression fixes for bundled plugins and channel plugins.

Fixes included:

  • #69793: Telegram photo inbound media type classification
  • #69783: Bun global install hang (jitiFilename modulePath fix)
  • #69831: Telegram grammy version mismatch (staging skip + bundledDependencies)
  • #70025: Feishu @larksuiteoapi/node-sdk missing bundledDependencies
  • #70026: SIGTERM instead of SIGKILL for supervisor cleanup
  • #69478: Deduplicate enqueued system events
  • #69229: Task createdAt/startAt timestamp clamping
  • #69410: AssistantTexts populated at message_end
  • #69369: Docker binds in RemoteShellSandboxFsBridge
  • #69289: Resolve ax refs in browser actions

Changed files

  • extensions/browser/src/browser/pw-session.test.ts (modified, +75/-0)
  • extensions/browser/src/browser/pw-session.ts (modified, +65/-0)
  • extensions/browser/src/browser/pw-tools-core.browser-ssrf-guard.test.ts (modified, +1/-0)
  • extensions/browser/src/browser/pw-tools-core.snapshot.ts (modified, +10/-1)
  • extensions/feishu/package.json (modified, +3/-0)
  • extensions/telegram/package.json (modified, +4/-1)
  • extensions/telegram/src/bot-message-context.body.ts (modified, +10/-1)
  • extensions/whatsapp/src/auto-reply.web-auto-reply.last-route.test.ts (modified, +109/-0)
  • extensions/whatsapp/src/auto-reply/monitor/on-message.ts (modified, +6/-0)
  • src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.custom-provider-payloads.test.ts (added, +113/-0)
  • src/agents/pi-embedded-subscribe.ts (modified, +5/-3)
  • src/agents/sandbox/remote-fs-bridge.test.ts (modified, +57/-0)
  • src/agents/sandbox/remote-fs-bridge.ts (modified, +16/-2)
  • src/infra/system-events.test.ts (modified, +31/-0)
  • src/infra/system-events.ts (modified, +6/-1)
  • src/plugins/bundled-capability-runtime.ts (modified, +1/-1)
  • src/plugins/bundled-channel-config-metadata.ts (modified, +1/-1)
  • src/plugins/loader.ts (modified, +1/-1)
  • src/plugins/public-surface-loader.ts (modified, +2/-2)
  • src/plugins/source-loader.ts (modified, +1/-1)
  • src/process/supervisor/supervisor.ts (modified, +1/-1)
  • src/tasks/task-registry.audit.test.ts (modified, +77/-0)
  • src/tasks/task-registry.ts (modified, +7/-4)

PR #70190: fix(telegram): align grammy version spec to installed 1.41.x

Description (problem / solution / changelog)

Fixes #70137 (also tracked as #69831).

Problem

After upgrading to v2026.4.21, the gateway crash-loops on startup with:

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: Error: Cannot find module 'grammy'
Require stack:
- .../dist/extensions/telegram/allowed-updates-*.js

Root cause

extensions/telegram/package.json declares "grammy": "^1.42.0", but the version actually present at install time is 1.41.1. scripts/stage-bundled-plugin-runtime-deps.mjs calls dependencyVersionSatisfied(spec, installedVersion) before staging — the ^1.42.0 range is not satisfied by 1.41.1, so grammy is silently skipped and never copied into dist/extensions/telegram/node_modules/. At runtime the telegram extension fails to require it.

Fix

Change the spec to ^1.41.0 so it matches the installed version. One-line, single-file diff. Verified locally — gateway boots clean and Telegram channel comes up.

Why a separate PR

PR #70091 already proposes the same one-line change but bundles 9 unrelated cherry-picks (~595 additions across 21 files) plus two open Greptile review findings, which will slow it down. This regression is breaking every install on v2026.4.21, so a minimal targeted fix seems worth the duplication. Happy to close this if #70091's grammy commit can be cherry-picked separately.

Changed files

  • extensions/telegram/package.json (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Update Result: ERROR Root: /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw Reason: openclaw doctor Before: 2026.4.20 After: 2026.4.20

Steps to reproduce

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Expected behavior

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

Actual behavior

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

OpenClaw version

openclaw 2026.4.20

Operating system

Ubuntu 24.04

Install method

npm global

Model

chatpgt 5.4

Provider / routing chain

no

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue is likely due to a missing dependency, 'grammy', which is required by the openclaw extension, and can be resolved by installing the required package.

Guidance

  • Verify that 'grammy' is not installed by running npm ls grammy in the openclaw project directory.
  • Install 'grammy' using npm by running npm install grammy in the openclaw project directory.
  • Check the openclaw documentation to see if 'grammy' is a required dependency and if there are any specific installation instructions.
  • If 'grammy' is not a required dependency, investigate why the openclaw extension is trying to require it.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue may be specific to the openclaw version (2026.4.20) or the Node.js version (v24.6.0) being used. Further investigation may be required to determine the root cause.

Recommendation

Apply workaround: Install 'grammy' using npm. This is a temporary solution until the root cause is determined and a permanent fix is applied.

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…

FAQ

Expected behavior

openclaw update

Error: Cannot find module 'grammy' Require stack:

  • /home/user/.nvm/versions/node/v24.6.0/lib/node_modules/openclaw/dist/extensions/telegram/allowed-updates-BD2bJyzD.js

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 [Bug]: Error: Cannot find module 'grammy' [3 pull requests, 6 comments, 7 participants]