openclaw - ✅(Solved) Fix Telegram plugin crashes CLI: grammy not in package dependencies, lost on every update [1 pull requests, 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#59867Fetched 2026-04-08 02:39:36
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
referenced ×2cross-referenced ×1

The Telegram extension requires grammy, @grammyjs/runner, and @grammyjs/transformer-throttler at runtime, but none are listed in package.json under dependencies, optionalDependencies, or peerDependencies. They're only present as runtime require() calls in bundled dist files.

This means every auto-update or brew upgrade wipes these packages, making the CLI completely unusable — all commands fail immediately with PluginLoadFailureError.

Error Message

[plugins] telegram failed to load from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/telegram/index.js: Error: Cannot find module 'grammy' Require stack:

  • /opt/homebrew/lib/node_modules/openclaw/dist/sticker-cache-BqQLBzvo.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: telegram: Error: Cannot find module 'grammy'

Root Cause

The Telegram extension requires grammy, @grammyjs/runner, and @grammyjs/transformer-throttler at runtime, but none are listed in package.json under dependencies, optionalDependencies, or peerDependencies. They're only present as runtime require() calls in bundled dist files.

This means every auto-update or brew upgrade wipes these packages, making the CLI completely unusable — all commands fail immediately with PluginLoadFailureError.

Fix Action

Workaround

cd /opt/homebrew/lib/node_modules/openclaw
npm install --no-save --userconfig /dev/null grammy @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

Must re-run after every update.

PR fix notes

PR #59939: fix(telegram): restore grammy runtime deps to root package.json

Description (problem / solution / changelog)

Fix Summary

After commit 62b7b350c9 ('refactor: move bundled channel deps to plugin packages'), grammy, @grammyjs/runner, and @grammyjs/transformer-throttler were removed from the root package.json and placed only in extensions/telegram/package.json.

However, the bundled distribution (via brew/npm install) creates a shared cache bundle (sticker-cache-*.js) that imports from the Telegram plugin and requires grammy at runtime. Since grammy is only declared in the plugin's package.json (not bundled into the root), users get:

Error: Cannot find module 'grammy'
Require stack:
- /opt/homebrew/lib/node_modules/openclaw/dist/sticker-cache-BqQLBzvo.js

This makes the CLI completely unusable after auto-update — all commands fail immediately with PluginLoadFailureError.

Fix

Restore grammy, @grammyjs/runner, @grammyjs/transformer-throttler, and https-proxy-agent (also removed in same refactor) to root dependencies.

Testing

  • Verify Telegram plugin loads correctly after this change
  • Verify CLI works normally after auto-update

Fixes openclaw#59867

Changed files

  • package.json (modified, +4/-0)

Code Example

[plugins] telegram failed to load from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/telegram/index.js: Error: Cannot find module 'grammy'
Require stack:
- /opt/homebrew/lib/node_modules/openclaw/dist/sticker-cache-BqQLBzvo.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: telegram: Error: Cannot find module 'grammy'

---

cd /opt/homebrew/lib/node_modules/openclaw
npm install --no-save --userconfig /dev/null grammy @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart
RAW_BUFFERClick to expand / collapse

Description

The Telegram extension requires grammy, @grammyjs/runner, and @grammyjs/transformer-throttler at runtime, but none are listed in package.json under dependencies, optionalDependencies, or peerDependencies. They're only present as runtime require() calls in bundled dist files.

This means every auto-update or brew upgrade wipes these packages, making the CLI completely unusable — all commands fail immediately with PluginLoadFailureError.

Version

OpenClaw 2026.3.31 (213a704), macOS 26.3.1 (arm64), node 25.8.2 → 25.9.0 Installed via pnpm global (/opt/homebrew/bin/openclaw)

Steps to Reproduce

  1. Have Telegram configured with bot tokens
  2. Wait for auto-update (or run brew upgrade)
  3. Run any openclaw command

Expected

CLI works normally.

Actual

[plugins] telegram failed to load from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/telegram/index.js: Error: Cannot find module 'grammy'
Require stack:
- /opt/homebrew/lib/node_modules/openclaw/dist/sticker-cache-BqQLBzvo.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: telegram: Error: Cannot find module 'grammy'

CLI is completely unusable — can't even run openclaw status to diagnose.

Affected modules

Found via grep -roh "@grammyjs/[a-z-]*" dist/:

  • grammy
  • @grammyjs/runner
  • @grammyjs/transformer-throttler
  • @grammyjs/types (present transitively)

Workaround

cd /opt/homebrew/lib/node_modules/openclaw
npm install --no-save --userconfig /dev/null grammy @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

Must re-run after every update.

Suggestions

  1. Add grammy and @grammyjs/* packages to optionalDependencies so they survive reinstalls
  2. Make extension load failures non-fatal for the CLI — a broken plugin shouldn't prevent openclaw status from running (the primary diagnostic tool). The amazon-bedrock extension already soft-fails; telegram should too.
  3. Add a --skip-plugins or --safe-mode CLI flag for recovery scenarios

Related

Same class of issue affects amazon-bedrock (@aws-sdk/client-bedrock not in deps), but that one warns instead of crashing since it uses soft-fail.

extent analysis

TL;DR

Add grammy and @grammyjs/* packages to optionalDependencies in package.json to prevent them from being removed during updates.

Guidance

  • Verify that the grammy and @grammyjs/* packages are not listed in package.json under dependencies, optionalDependencies, or peerDependencies.
  • Run the provided workaround command to temporarily install the required packages and restart the openclaw gateway.
  • Consider implementing a --skip-plugins or --safe-mode CLI flag to allow the CLI to start even if a plugin fails to load.
  • Review the amazon-bedrock extension's soft-fail behavior as a potential model for the telegram extension.

Example

The workaround command provided in the issue can be used as a temporary solution:

cd /opt/homebrew/lib/node_modules/openclaw
npm install --no-save --userconfig /dev/null grammy @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

Notes

The issue is specific to the telegram extension and its dependencies, but a similar issue affects the amazon-bedrock extension. The provided workaround must be re-run after every update.

Recommendation

Apply the workaround by adding grammy and @grammyjs/* packages to optionalDependencies in package.json, as this will prevent them from being removed during updates and ensure the telegram extension can load correctly.

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