Skip to content

Telegram plugin crashes CLI: grammy not in package dependencies, lost on every update #59867

Description

@thecolormaroun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions