Skip to content

[Bug] Discord WebSocket reconnect drops events (seq gap), mentions lost #29420

@KJT125

Description

@KJT125

Description

After a Discord WebSocket disconnection (code 1006/1005), the gateway reconnects but loses events in the sequence gap. This causes missed @mentions and messages.

Steps to Reproduce

  1. Gateway running with Discord channel enabled
  2. Discord WebSocket drops (code 1006 abnormal closure)
  3. Gateway auto-reconnects ~7 seconds later
  4. Events between old seq and new seq are lost (e.g., seq 3289 → 3293, 4 events lost)

Expected Behavior

On reconnect, gateway should request missed events from Discord (via resume with last sequence number) so no events are dropped.

Actual Behavior

Events in the gap are silently lost. User mentions during the gap are never delivered to the agent.

Logs

discord gateway: WebSocket connection closed with code 1006 (2026-02-28T04:01:34Z)
discord gateway: WebSocket connection closed with code 1005 (2026-02-28T04:01:41Z)

Client-side warning: event gap detected (expected seq 3289, got 3293); refresh recommended

Environment

  • OpenClaw: latest npm
  • OS: Ubuntu 24.04 (WSL2)
  • Node: v22.22.0
  • Connection: via Tailscale HTTPS proxy

Related

Impact

In a multi-agent Discord setup (M1 + E3 bots in same server), missed mentions mean agents appear unresponsive even though gateway is running. User has to manually ping again in another channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions