WhatsApp stale-socket disconnect every ~35 min (+ rapid drops after restart)
Env: OpenClaw 2026.3.12, macOS Intel x64, Node v25.4.0, local gateway, launchd KeepAlive
Problem: Health-monitor detects stale-socket, restarts WhatsApp channel every ~35 min. 470+ occurrences since Feb 21. Messages fail during reconnect windows.
Pattern (Mar 12-13 timestamps):
19:45, 20:20, 20:55, 21:30, 22:05, 23:00, 23:35, 00:40, 03:15, 03:50, 05:20, 05:55, 06:30, 07:05, 07:40
~35 min intervals. Too regular for network issues.
Additional: After gateway restart (config.patch → SIGUSR1), listener reconnects but dies within 2-4 min — much faster than the 35-min cycle. Restart destabilizes the Baileys session.
Root cause: makeWASocket in source doesn't set keepAliveIntervalMs (uses Baileys default 30s). Socket silently dies ~20 min after connecting. 15-min health check catches it → 35 min cycle.
Impact: Outbound messages fail silently. Deliveries exceed max retries (5/5) → moved to failed/. Agent can't reliably message users.
Logs:
[health-monitor] [whatsapp:default] restarting (reason: stale-socket)
[whatsapp] No messages received in 30m - restarting connection
[whatsapp] Web connection closed (status 499)
Config: channelHealthCheckMinutes: 15, reconnect.maxAttempts: 0
Related: #41339 (Discord same pattern), #16270 (reconnect loop bans), #19856 (messages lost after reconnect)
Request: Expose Baileys socket tuning (keepAliveIntervalMs, connectTimeoutMs) as config. Investigate silent socket death.