Discord channel plugin: notifications stop working after attachment operations

Resolved 💬 2 comments Opened Mar 25, 2026 by karljuhlthefool Closed Apr 24, 2026

Problem

Inbound Discord messages stop reaching Claude Code after sending/receiving file attachments. The Discord bot appears healthy and tools continue working, but <channel> notifications never arrive, so Claude Code never wakes up for new messages.

Symptoms:

  • Bot responds to commands and tools work
  • But new Discord messages don't trigger Claude Code responses
  • Only fix is restarting the session with --channels
  • Attachments are a reliable trigger (especially multiple files or large files)

Root Cause

The Discord MCP plugin's mcp.notification() call is fire-and-forget with no retry:

// external_plugins/discord/server.ts:868
mcp.notification({...}).catch(err => {
  process.stderr.write(`discord channel: failed to deliver inbound to Claude: ${err}\n`)
})

When the notification fails (likely due to large attachment metadata payloads), the error is logged but the notification is lost. The MCP server stays connected but Claude Code stops receiving notifications permanently.

Proposed Fix

Wrap the notification in a retry loop with exponential backoff:

// Retry notification with backoff to recover from transient failures
void (async () => {
  for (let attempt = 1; attempt <= 3; attempt++) {
    try {
      await mcp.notification({
        method: 'notifications/claude/channel',
        params: { /* ... */ },
      })
      return
    } catch (err) {
      process.stderr.write(\`discord channel: notification attempt \${attempt}/3 failed: \${err}\n\`)
      if (attempt < 3) await new Promise(r => setTimeout(r, 500 * attempt))
    }
  }
})()

Changes: ~10 lines of code, no behavior change on success path, adds resilience on failure.

Verification

Tested in production use over multiple days:

  • ✅ Sending 10MB+ files works
  • ✅ Sending multiple files at once works
  • ✅ Text messages continue working after attachment operations
  • ✅ No more "zombie" sessions requiring restart

Related

View original on GitHub ↗

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