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
When the health-monitor detects a stale-socket condition and triggers a Discord gateway restart, a race condition causes an uncaught exception that crashes the entire OpenClaw process.
Error
[health-monitor] [discord:default] health-monitor: restarting (reason: stale-socket)
Uncaught exception: Error: Max reconnect attempts (0) reached after code 1005
at SafeGatewayPlugin.handleReconnectionAttempt (GatewayPlugin.ts:400:5)
at SafeGatewayPlugin.handleClose (GatewayPlugin.ts:484:8)
Root Cause (traced to dist)
In provider-D-9qP6__.js, the onAbort handler (triggered during gateway stop/restart) sets:
gateway.options.reconnect={maxAttempts: 0};
This is intentional to prevent reconnect loops on clean shutdown. However, during a health-monitor restart, the WebSocket drops with close code 1005before the clean disconnect completes. The handleClose fires, hits maxAttempts: 0, emits an error, and the uncaught exception handler takes down the whole process.
Impact
Entire OpenClaw process crashes (not just the Discord plugin)
Any background tasks (e.g. long-running scripts) are killed as collateral damage
The gateway does not self-heal / restart
Expected Behavior
The health-monitor restart should be resilient to WebSocket drops during the restart cycle. Either the uncaught exception should be caught and the gateway restarted cleanly, or maxAttempts: 0 should only be set after disconnect completes successfully.
Workaround
None currently. Manual openclaw gateway restart required after each occurrence.
Activity
steipete commentedon Mar 26, 2026
Closing as a duplicate of #54894.
This matches the same stale-socket or abort crash family tracked in #54931 and fixed by #55000:
Max reconnect attempts (0)errorKeeping canonical tracking on #54894 and the fix discussion on #55000.