Skip to content

Discord WebSocket resume loop never recovers — needs circuit breaker / fresh IDENTIFY fallback #14331

Closed as not planned

Description

@Stache73

Description

The Discord gateway WebSocket connection can enter an unrecoverable reconnect loop where it endlessly retries resume with ~1s backoff, never falling back to a fresh IDENTIFY. The only fix is a full gateway restart.

Observed behaviour

  • Discord WS closes with code 1006 (abnormal closure)
  • Provider immediately begins resume attempts at ~1s intervals
  • Every attempt fails with code 1005 (no status received)
  • Periodically logs: connection stalled: no HELLO received within 30000ms, forcing reconnect
  • Occasionally: WebSocket was closed before the connection was established (code 1006)
  • This continues indefinitely (observed 3.5+ hours) until the gateway process is restarted
  • During the spiral, Slow listener detected warnings appear (30-90s+ per MESSAGE_CREATE)

Expected behaviour

After N failed resume attempts, the provider should:

  1. Invalidate the current session/resume token
  2. Fall back to a fresh IDENTIFY (new session)
  3. Or at minimum, use exponential backoff instead of constant 1s retries

Environment

  • OpenClaw 2026.2.9
  • Windows 10, Node v24.6.0
  • channels.discord.retry is configured but only affects API calls, not the WS gateway

Workaround

Full gateway restart clears the spiral every time.

Related

PR #5564 addresses "zombie reconnect" and code 4014 handling but not this specific resume-loop pattern.

Activity

  1. added
    bug
    on Feb 12, 2026
  2. sebslight commented on Feb 13, 2026

    @sebslight
    Contributor

    Closing as duplicate of #13180. If this is incorrect, comment and we can reopen.

  3. locked as resolved and limited conversation to collaborators on Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions