Telegram plugin: inbound text messages silently dropped when Claude Code is busy or zombie session exists
Summary
Inbound Telegram text messages are silently lost in two scenarios, even though the bot's typing indicator fires correctly (user sees \"replying\" but never receives a response).
Root cause (from server.ts source analysis)
1. No persistence for text messages
Text messages are delivered exclusively via mcp.notification() (fire-and-forget, server.ts:925). Unlike photo/attachment messages which are written to the inbox directory, text messages have no on-disk fallback. If the MCP notification is not consumed (e.g. Claude Code is mid-turn processing another response), the message is permanently lost with no recovery path.
2. Zombie polling window on session restart (server.ts:956)
When Claude Code restarts, the previous bot polling connection may still be active. The new instance detects a 409 Conflict and backs off (up to 15s per attempt). During this window, messages are consumed by the zombie polling session but never delivered to any active Claude Code session → permanent loss.
Observed behavior
- Bot sends
sendChatAction('typing')immediately on receipt (user sees typing indicator) mcp.notification()fires but the notification is silently dropped- User waits, no response arrives — message is gone
- Inbox contains only photo files; no trace of lost text messages
Reproduction
- Send a text message to the bot while Claude Code is generating a response to a previous message
- OR restart Claude Code and immediately send a message during the 409 backoff window
Suggested fixes
- Buffer text messages: write pending text messages to the inbox directory (similar to photos) so they survive a busy/restart window and can be replayed
- Notification queue: hold inbound MCP notifications until the current turn completes rather than dropping them
- Reduce zombie window: call
bot.api.close()or equivalent on Claude Code shutdown to release the polling slot immediately
Environment
- Plugin:
telegram@claude-plugins-officialv0.0.4 - Platform: macOS (Darwin 24.6.0)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗