Files
cc-connect/platform
quabugandClaude Opus 4.6 1de79e4bfa fix(discord): deduplicate gateway MessageCreate events (#122)
Discord's gateway can deliver the same MessageCreate event twice during
reconnect/resume, causing duplicate agent responses.

Add a sync.Map-based dedup on message ID with a 2-minute TTL to the
Discord platform handler. The second delivery of the same msg_id is
silently dropped before reaching the engine.

Root cause: when discordgo's WebSocket connection drops and resumes, the
gateway may replay events already delivered before the disconnection.
Since AddHandler registers persistent handlers that survive reconnects,
both the original and replayed event fire the same callback.

Closes #122

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 08:39:29 -07:00
..