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 creates gateway with maxAttempts=0, causing immediate crash on next disconnect #55873
When the Discord health-monitor detects a stale-socket and restarts the Discord provider, the new gateway instance is created without propagating the original reconnect options. This causes maxAttempts to be 0, so the very next WebSocket disconnect triggers an uncaught exception that kills the entire openclaw-gateway process.
When the health monitor restarts the provider via monitorDiscordProvider, the new gateway plugin instance does not receive the same reconnect options
@buape/carbon's GatewayPlugin.handleReconnectionAttempt() destructures maxAttempts from this.options.reconnect ?? {}, resulting in 0 (or the default 5 depending on path)
The error message explicitly shows (0), confirming the options were not propagated
Workaround
Added auto-restart logic in the proxy server.mjs to relaunch the gateway on non-zero exit:
w.on("exit",e=>{n.warn(`OpenClaw exited with code ${e}`);w=null;if(e!==0){n.info("Auto-restarting OpenClaw gateway in 5s...");setTimeout(()=>Q(),5e3);}});
Suggested fix
Ensure monitorDiscordProvider (or whichever function handles health-monitor restarts) passes the same reconnect options that createDiscordGatewayPlugin uses when creating the initial gateway instance.
Closing as fixed upstream. This crash family was addressed by upstream Discord lifecycle changes merged in #55991, and PR #55000 was closed after the upstream maintainer confirmed the fix landed there.
If you still hit the same Max reconnect attempts (0) / stale-socket gateway crash on the latest OpenClaw release, comment here with fresh logs and version details and we can reopen or spin a new issue.
Activity
Takhoffman commentedon Mar 29, 2026
Closing as fixed upstream. This crash family was addressed by upstream Discord lifecycle changes merged in #55991, and PR #55000 was closed after the upstream maintainer confirmed the fix landed there.
If you still hit the same
Max reconnect attempts (0)/ stale-socket gateway crash on the latest OpenClaw release, comment here with fresh logs and version details and we can reopen or spin a new issue.