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
- Run OpenClaw gateway with WhatsApp channel connected
- Leave gateway idle for ~30 minutes
- 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
Impact
Gateway becomes effectively non-functional — continuous disconnections prevent any meaningful operation. Workaround: restart gateway to clear idle counter temporarily.
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
Expected Behavior
Gateway should reconnect normally after idle timeout without entering a reconnect loop.
Actual Behavior
Log excerpt:
Environment
Related Issues
Impact
Gateway becomes effectively non-functional — continuous disconnections prevent any meaningful operation. Workaround: restart gateway to clear idle counter temporarily.