openclaw - 💡(How to fix) Fix Cascading reconnects every ~30min after idle (Gateway WebSocket) [1 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#59589Fetched 2026-04-08 02:42:49
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Root Cause

After approximately 30 minutes of idle time, the WhatsApp gateway begins a cascading reconnect loop. The root cause is that the idle counter increments continuously rather than resetting after each reconnect.

Fix Action

Fix / Workaround

Gateway becomes effectively non-functional — continuous disconnections prevent any meaningful operation. Workaround: restart gateway to clear idle counter temporarily.

Code Example

"Message timeout detected - forcing reconnect"
"minutesSinceLastMessage":30
"WhatsApp Web connection closed (status 499)"
"web reconnect: connection closed"
"web reconnect: scheduling retry"
RAW_BUFFERClick to expand / collapse

Bug Description

After approximately 30 minutes of idle time, the WhatsApp gateway begins a cascading reconnect loop. The root cause is that the idle counter increments continuously rather than resetting after each reconnect.

Steps to Reproduce

  1. Run OpenClaw gateway with WhatsApp channel connected
  2. Leave gateway idle for ~30 minutes
  3. Observe: gateway begins disconnecting every 30-60 seconds in a cascading loop

Expected Behavior

Gateway should reconnect normally after idle timeout without entering a reconnect loop.

Actual Behavior

  • Idle timeout triggers at 30 minutes → forces reconnect
  • After reconnect, idle counter does not reset to 0
  • Within seconds/minutes of reconnect, the idle timeout fires again
  • This creates an infinite loop of disconnect/reconnect cycles

Log excerpt:

"Message timeout detected - forcing reconnect"
"minutesSinceLastMessage":30
"WhatsApp Web connection closed (status 499)"
"web reconnect: connection closed"
"web reconnect: scheduling retry"

Environment

  • OpenClaw version: 2026.4.1 (also affected 2026.3.31)
  • OS: Linux (WSL2)
  • Node: 22.22.1
  • Gateway mode: local, loopback
  • Channel: WhatsApp

Related Issues

  • Possibly related to #13544 (Feb 10)
  • Possibly related to #14000 (Feb 11)

Impact

Gateway becomes effectively non-functional — continuous disconnections prevent any meaningful operation. Workaround: restart gateway to clear idle counter temporarily.

extent analysis

TL;DR

The WhatsApp gateway can be temporarily fixed by resetting the idle counter after each reconnect to prevent the cascading reconnect loop.

Guidance

  • Review the reconnect logic to ensure the idle counter is reset to 0 after a successful reconnect.
  • Verify the idle timeout configuration to confirm it is set to trigger after 30 minutes of inactivity.
  • Investigate related issues #13544 and #14000 for potential patches or workarounds that may address the idle counter reset issue.
  • Consider implementing a temporary workaround to manually reset the idle counter after a reconnect, similar to restarting the gateway.

Example

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

Notes

The provided log excerpt suggests that the idle counter is not being reset after a reconnect, causing the infinite loop. However, without access to the OpenClaw gateway code, it is difficult to provide a precise fix.

Recommendation

Apply workaround: Implement a temporary fix to reset the idle counter after each reconnect, as this will prevent the cascading reconnect loop and allow the gateway to function normally until a permanent fix is 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 Cascading reconnects every ~30min after idle (Gateway WebSocket) [1 participants]