Problem
Messages sent via the Webchat UI are silently lost when the WebSocket connection drops and reconnects (code 1001 / "Going Away"). This happens when:
- The browser tab reloads or navigates
- The WebSocket briefly disconnects for any reason
- The user hits Enter at the exact moment of a reconnect cycle
The gateway never receives the message, so there is nothing to drop server-side — it simply never arrives.
Evidence
Gateway logs show rapid disconnect/reconnect cycles:
2026-03-14T10:46:40.506+01:00 [ws] webchat disconnected code=1001 conn=abd60847
2026-03-14T10:46:40.750+01:00 [ws] webchat connected conn=96f826be
2026-03-14T10:46:52.316+01:00 [ws] webchat disconnected code=1001 conn=96f826be
2026-03-14T10:46:52.458+01:00 [ws] webchat connected conn=0a55022e
User-sent message during this window was lost with no error feedback.
Expected behavior
Messages should be queued client-side and only removed from the queue after server ACK. On reconnect, unACKed messages should be re-sent automatically.
Suggested fix
- Client-side outbound queue: Buffer messages locally before sending
- Server ACK: Gateway responds with an ACK per message received
- Retry on reconnect: After WebSocket reconnects, flush any unACKed messages from the queue
- UI feedback: If a message cannot be delivered after N retries, show an error indicator on that message (like messaging apps do)
Environment
- OpenClaw Gateway on macOS (Darwin 25.3.0 arm64)
- Webchat Control UI v2026.3.12
- Occurs intermittently, more likely during rapid interactions or tab focus changes
Problem
Messages sent via the Webchat UI are silently lost when the WebSocket connection drops and reconnects (code 1001 / "Going Away"). This happens when:
The gateway never receives the message, so there is nothing to drop server-side — it simply never arrives.
Evidence
Gateway logs show rapid disconnect/reconnect cycles:
User-sent message during this window was lost with no error feedback.
Expected behavior
Messages should be queued client-side and only removed from the queue after server ACK. On reconnect, unACKed messages should be re-sent automatically.
Suggested fix
Environment