You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discord health monitor restart crashes gateway: Max reconnect attempts (0) reached #55165
The Discord health monitor detects stale WebSocket connections and attempts to restart the Discord provider. However, the reconnection logic has max reconnect attempts set to 0, which causes an uncaught exception that crashes the entire gateway process.
Error
[openclaw] Uncaught exception: Error: Max reconnect attempts (0) reached after code 1005
at SafeGatewayPlugin.handleReconnectionAttempt (provider-CAlWEl41.js:3318:47)
at SafeGatewayPlugin.handleClose (provider-CAlWEl41.js:3364:8)
at WebSocket.<anonymous> (provider-CAlWEl41.js:3307:9)
Reproduction
Run gateway with Discord channel enabled and health monitor active (default)
Wait for a Discord WebSocket to go stale (network hiccup, missed heartbeat ACK)
Health monitor detects stale-socket after ~35 minutes and triggers restart
Reconnection immediately fails with Max reconnect attempts (0)
Uncaught exception kills the entire gateway process (all channels, cron, etc.)
Log sequence
[gateway/health-monitor] [discord:default] health-monitor: restarting (reason: stale-socket)
[openclaw] Uncaught exception: Error: Max reconnect attempts (0) reached after code 1005
This cycle repeated multiple times over 24 hours (gateway restarts via Windows Scheduled Task, then crashes again on next stale socket detection).
Expected behavior
The health monitor restart should use a reasonable reconnect attempt limit (e.g., 3-5 attempts with backoff) rather than 0, and the failure should be handled gracefully without crashing the entire gateway.
Workaround
Disabling the Discord health monitor via config patch.
Activity
steipete commentedon Mar 26, 2026
Closing as a duplicate of #54894.
This matches the same Discord reconnect or abort crash path tracked in #54931 and fixed by PR #55000:
Keeping the canonical tracking on #54894 plus the fix discussion on #55000.