openclaw - 💡(How to fix) Fix [Bug] Discord reconnect drops inbound messages on v2026.4.26 — MESSAGE_CREATE listeners lost after hot-reload [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75719Fetched 2026-05-02 05:31:13
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

On OpenClaw v2026.4.26 (be8c246), inbound Discord messages are silently dropped during normal WebSocket reconnect cycles (Discord code 1000, occurring every ~10 minutes).

Root Cause

Root Cause (suspected)

Code Example

[discord] client initialized as <bot_id>; awaiting gateway readiness
RAW_BUFFERClick to expand / collapse

Description

On OpenClaw v2026.4.26 (be8c246), inbound Discord messages are silently dropped during normal WebSocket reconnect cycles (Discord code 1000, occurring every ~10 minutes).

Behavior

  • Discord.js receives the message (👀 reaction is placed by the bot)
  • But OpenClaw never routes it to the session — Ollama is never called
  • The drop happens in the routing layer after Discord.js event fires, during the "awaiting gateway readiness" window following a WS reconnect

Root Cause (suspected)

This appears to be the secondary issue identified in #61703: when a Discord WebSocket reconnects, OpenClaw performs a hot-reload that creates a new provider instance, but the new provider either reuses a stale gateway object or fails to rebind MESSAGE_CREATE listeners. The original cold-start race condition fix (commit 86f8c826e2) was confirmed, but the hot-reload reconnect listener loss was not confirmed fixed in origin/main at that time.

Reproduction

  1. Connect OpenClaw Discord bot to a guild with requireMention: false
  2. Wait for Discord WS to close (code 1000, happens every ~10 min)
  3. Send an @mention during the ~2-minute "awaiting gateway readiness" window
  4. Bot places 👀 reaction but never processes the message
  5. Gateway logs confirm the Discord.js client received the event (👀 placed) but OpenClaw session routing never fires

Gateway Log Evidence

[discord] client initialized as <bot_id>; awaiting gateway readiness

This is the last Discord log entry before the message drop window. After reconnect, any messages received before this state clears are silently dropped.

Environment

  • OpenClaw version: 2026.4.26 (be8c246)
  • OS: Fedora 43 / Bazzite (Linux)
  • Discord guild: requireMention: false
  • Channel health: channelHealthCheckMinutes=2, channelStaleEventThresholdMinutes=5
  • Model: ollama/qwen3-vl:8b

Impact

High — for production Discord bots, @mentions sent during the standard ~10-minute WS reconnect window are permanently lost. No replay, no queue, no retry.

Notes

  • gateway.eventQueue.listenerTimeout was investigated — confirmed does not exist in the schema
  • channels.discord.retry was investigated — confirmed does not exist for inbound messages
  • The system works correctly outside the reconnect window
  • Related: #61703 (secondary finding), #54691 (awaiting gateway readiness detection)

extent analysis

TL;DR

The most likely fix involves addressing the hot-reload reconnect listener loss issue in OpenClaw, ensuring that the new provider instance correctly rebinds MESSAGE_CREATE listeners after a WebSocket reconnect.

Guidance

  • Investigate the MESSAGE_CREATE listener binding process in the OpenClaw provider instance to identify why it fails to rebind after a hot-reload reconnect.
  • Review the commit 86f8c826e2 and its relation to the cold-start race condition fix to understand potential similarities with the hot-reload issue.
  • Verify that the Discord.js client is correctly configured to handle WebSocket reconnects and that the awaiting gateway readiness state is properly cleared after reconnect.
  • Check the OpenClaw documentation and related issues (e.g., #61703, #54691) for any existing workarounds or fixes for the hot-reload reconnect listener loss issue.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The fix may require changes to the OpenClaw provider instance or the Discord.js client configuration. The issue seems to be related to a known problem (#61703), but the exact solution is not provided in the issue.

Recommendation

Apply a workaround to address the hot-reload reconnect listener loss issue, as the root cause is suspected to be related to a known problem (#61703) and a fix may not be readily available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug] Discord reconnect drops inbound messages on v2026.4.26 — MESSAGE_CREATE listeners lost after hot-reload [1 comments, 2 participants]