Bug Description
After upgrading to v2026.3.7, messages sent in Slack appear twice in the WebUI (Control UI). The issue does not affect Slack — only the WebUI shows duplicates.
Environment
- openclaw v2026.3.7 (42a1394)
- macOS (Darwin 25.3.0)
- Slack channel integration (socket mode)
Steps to Reproduce
- Open WebUI (Control UI) connected to a Slack-bound agent session
- Send a message in the Slack thread
- Observe the message appears twice in the WebUI
Root Cause Analysis
1. Frequent WebSocket disconnections (new in v2026.3.7)
Gateway logs show the WebUI WebSocket disconnects every 30-120 seconds with code=1001:
17:05:30 [ws] webchat disconnected code=1001
17:05:30 [ws] webchat connected (v2026.3.7)
17:06:14 [ws] webchat disconnected code=1001 ← 44s later
17:06:14 [ws] webchat connected
17:07:45 [ws] webchat disconnected code=1001 ← 91s later
17:08:46 [ws] webchat disconnected code=1001 ← 61s later
Before the upgrade, WebSocket connections were stable for hours without disconnecting.
2. loadChatHistory() replaces messages without deduplication
On reconnect, onHello triggers loadChatHistory() which does:
state.chatMessages = messages.filter((message) => !isAssistantSilentReply(message));
This completely replaces the in-memory message array. If a message was already displayed via real-time push before the disconnect, it appears again after the history reload.
3. Index-based keys in chat rendering
buildChatItems() uses array-index-based keys (messageKey(tools[i], i + history.length)) instead of stable message IDs, so React/Lit cannot detect duplicates during re-render.
Suggested Fix
- Use message ID (or timestamp + sender hash) as dedup key in
loadChatHistory()
- Merge fetched history with existing
state.chatMessages instead of replacing
- Use stable message ID-based keys in
buildChatItems() instead of array indices
- Investigate why WebSocket disconnects so frequently in v2026.3.7 (was stable pre-upgrade)
Workaround
None currently — investigating local patch options.
Bug Description
After upgrading to v2026.3.7, messages sent in Slack appear twice in the WebUI (Control UI). The issue does not affect Slack — only the WebUI shows duplicates.
Environment
Steps to Reproduce
Root Cause Analysis
1. Frequent WebSocket disconnections (new in v2026.3.7)
Gateway logs show the WebUI WebSocket disconnects every 30-120 seconds with
code=1001:Before the upgrade, WebSocket connections were stable for hours without disconnecting.
2.
loadChatHistory()replaces messages without deduplicationOn reconnect,
onHellotriggersloadChatHistory()which does:This completely replaces the in-memory message array. If a message was already displayed via real-time push before the disconnect, it appears again after the history reload.
3. Index-based keys in chat rendering
buildChatItems()uses array-index-based keys (messageKey(tools[i], i + history.length)) instead of stable message IDs, so React/Lit cannot detect duplicates during re-render.Suggested Fix
loadChatHistory()state.chatMessagesinstead of replacingbuildChatItems()instead of array indicesWorkaround
None currently — investigating local patch options.