Telegram channel plugin drops messages: mcp.notification() not awaited in handleInbound
Resolved 💬 2 comments Opened Apr 5, 2026 by sonsay Closed May 16, 2026
Bug
The Telegram channel plugin (external_plugins/telegram/server.ts) silently drops incoming messages because mcp.notification() is called without await in the handleInbound() function (line ~925).
Root cause
// server.ts:925 — fire-and-forget, NOT awaited
mcp.notification({
method: 'notifications/claude/channel',
params: { ... },
}).catch(err => {
process.stderr.write(`telegram channel: failed to deliver inbound to Claude: ${err}\n`)
})
The grammy handler completes and acks the message to Telegram before the notification is actually delivered to Claude. If Claude is busy processing (tool calls, long operations), the notification can fail silently:
- User sends message in Telegram
- grammy receives it, calls
handleInbound() handleInbound()callsmcp.notification()without await and returns- grammy marks message as processed in Telegram
mcp.notification()fails (Claude busy) → only stderr log- User's message is gone — Telegram thinks it's delivered, Claude never saw it
Symptoms
- Messages sent while Claude is processing tool calls are silently lost
- Messages sent in quick succession may be dropped
- User sees no error — message appears sent in Telegram
- Only evidence is stderr log that nobody reads
Suggested fix
// Await the notification + add retry
for (let attempt = 0; attempt < 3; attempt++) {
try {
await mcp.notification({
method: 'notifications/claude/channel',
params: { ... },
})
break
} catch (err) {
if (attempt < 2) {
await new Promise(r => setTimeout(r, 200 * Math.pow(2, attempt)))
} else {
process.stderr.write(`telegram channel: DROPPED message: ${err}\n`)
}
}
}
Environment
- Claude Code 2.1.86 on Linux (Hetzner vm1)
- Telegram plugin from official marketplace
- Bug is 100% reproducible under load
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗