Telegram plugin: bot polling disconnects silently with no reconnect

Resolved 💬 3 comments Opened Mar 21, 2026 by rsh2k1-2026 Closed Mar 24, 2026

Description

The Telegram plugin (plugin:telegram:telegram) disconnects silently during a session and requires manual reconnection via /mcp. This happens multiple times per session.

Root Cause

The plugin uses grammy's bot.start() for long-polling but has no error handling or reconnection logic (server.ts:594-599):

void bot.start({
  onStart: info => {
    botUsername = info.username
    process.stderr.write(`telegram channel: polling as @${info.username}\n`)
  },
})

No bot.catch(), no onError, no polling error handler. When the long-polling connection drops (network change, Mac sleep, Telegram API timeout), the bot dies silently and the MCP server disconnects.

Expected Behavior

  • Bot should automatically reconnect on polling errors
  • At minimum, bot.catch() should log errors to stderr so users know what happened
  • Ideally, grammy's built-in retry logic should be configured

Steps to Reproduce

  1. Start a Claude Code session with the Telegram plugin connected
  2. Wait ~15-30 minutes (or trigger a network change)
  3. The plugin silently disconnects — no error, no notification
  4. Messages sent from Telegram are lost
  5. Must manually reconnect via /mcp

Environment

  • Claude Code 2.1.80
  • macOS Darwin 25.2.0
  • Plugin: claude-plugins-official/telegram/0.0.1

Suggested Fix

Add error handling to the bot startup:

bot.catch((err) => {
  process.stderr.write(`telegram channel: bot error: ${err.message}\n`)
})

void bot.start({
  onStart: info => {
    botUsername = info.username
    process.stderr.write(`telegram channel: polling as @${info.username}\n`)
  },
  drop_pending_updates: false,
})

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗