[BUG] Telegram plugin drops inbound messages — mcp.notification() not awaited (fire-and-forget)

Resolved 💬 2 comments Opened Apr 1, 2026 by elkavayo Closed May 8, 2026

Description

The Telegram plugin's handleInbound() function calls mcp.notification() without await, making message delivery to Claude Code fire-and-forget. When the MCP transport is slow or busy, the promise resolves after the handler has already returned, and messages are silently dropped.

Root Cause

File: external_plugins/telegram/server.ts

Line 925 — main channel notification:

// Current (broken): fire-and-forget
mcp.notification({
  method: 'notifications/claude/channel',
  params: { ... },
}).catch(err => {
  process.stderr.write(`telegram channel: failed to deliver inbound to Claude: ${err}\n`)
})

Line 891 — permission notification (same issue):

void mcp.notification({
  method: 'notifications/claude/channel/permission',
  params: { ... },
})

Neither call is awaited. The handler returns immediately without waiting for MCP transport acknowledgment. Under any transport latency, messages are lost.

Fix

Add await to both calls:

// Line 925
await mcp.notification({ ... }).catch(err => { ... })

// Line 891
await mcp.notification({ ... })

Related Issues

This is likely the root cause (or a contributing factor) for:

  • #37933 — Telegram plugin inbound messages not delivered
  • #36431 — Telegram plugin: inbound MCP channel notifications not delivered
  • #36802 — notifications/claude/channel not delivered to session
  • #38259 — Telegram channel stops processing inbound messages after completing a turn

Environment

  • Claude Code: latest (April 2026)
  • Plugin: claude-channel-telegram v0.0.1
  • Runtime: Bun
  • grammy: ^1.21.0

View original on GitHub ↗

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