Skip to content

[Bug]: Discord provider crashes entire gateway process on reconnect failure — hardcoded 0 max reconnect attempts #56588

Description

@dreidrage

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

The Discord WebSocket provider crashes with an uncaught exception when reconnection fails, bringing down the entire
gateway process. The Discord provider appears to be hardcoded to 0 max reconnect attempts, causing immediate
termination.

Steps to reproduce

Steps to reproduce:

  1. Start OpenClaw gateway with Discord channel enabled
  2. Wait for Discord WebSocket connection to drop (codes 1005 or 1006)
  3. Health monitor attempts restart
  4. Discord provider throws: Error: Max reconnect attempts (0) reached after code 1005
  5. Entire gateway process terminates with uncaught exception

Expected behavior

Discord provider should retry reconnecting a reasonable number of times (3-5) with backoff before giving up.
Reconnection failures should be handled gracefully and not crash the gateway.

Actual behavior

Uncaught exception kills the gateway process immediately.

Log excerpt:

  {"subsystem":"gateway/health-monitor"} "[discord:default] health-monitor: restarting (reason: stale-socket)"
  [openclaw] Uncaught exception: Error: Max reconnect attempts (0) reached after code 1005
      at SafeGatewayPlugin.handleReconnec tionAttempt ...

OpenClaw version

2026.3.24

Operating system

OS: Windows 10.0.26200 (x64)

Install method

No response

Model

ollama kimi

Provider / routing chain

openclaw-discord

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions