openclaw - 💡(How to fix) Fix [Bug]: WebChat duplicate/collapsed messages after tool calls [3 comments, 3 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#74548Fetched 2026-04-30 06:23:07
View on GitHub
Comments
3
Participants
3
Timeline
4
Reactions
2
Author
Timeline (top)
commented ×3closed ×1

Messages in the WebChat UI occasionally appear duplicated — both user messages and assistant responses are shown twice consecutively. The issue is intermittent (flaky). It tends to reappear after several tool invocations (especially exec). Restarting the Gateway temporarily resolves it until the next round of tool calls.

Sometimes the duplication manifests as a merge/collapse of two consecutive assistant replies into one garbled block, as if a race condition in websocket delivery combines them.

Error Message

  • No error logs visible client-side.

Root Cause

Messages in the WebChat UI occasionally appear duplicated — both user messages and assistant responses are shown twice consecutively. The issue is intermittent (flaky). It tends to reappear after several tool invocations (especially exec). Restarting the Gateway temporarily resolves it until the next round of tool calls.

Sometimes the duplication manifests as a merge/collapse of two consecutive assistant replies into one garbled block, as if a race condition in websocket delivery combines them.

RAW_BUFFERClick to expand / collapse

Description

Messages in the WebChat UI occasionally appear duplicated — both user messages and assistant responses are shown twice consecutively. The issue is intermittent (flaky). It tends to reappear after several tool invocations (especially exec). Restarting the Gateway temporarily resolves it until the next round of tool calls.

Sometimes the duplication manifests as a merge/collapse of two consecutive assistant replies into one garbled block, as if a race condition in websocket delivery combines them.

Steps to reproduce

  1. Start a fresh WebChat session (Gateway restarted).
  2. Exchange a few messages — everything looks normal.
  3. Invoke a tool command (e.g., exec, write + reply in the same turn).
  4. Observe: the user or assistant messages now appear twice in the chat.
  5. Refreshing the page may temporarily clear it, but it returns after more tool calls.

Expected behavior

Each user message and each assistant reply should appear exactly once, in correct order, without duplication or merging.

Environment

  • OpenClaw version: 2026.4.26 (be8c246)
  • Installed via: npm (global)
  • WebChat channel only (not tested on other channels)
  • Model: deepseek/deepseek-chat (but likely unrelated — issue is in the webchat routing layer)
  • Host: WSL2 (Ubuntu), Node v24.15.0

Additional notes

  • First observed on 2026-04-16, returned after 2026-04-26 update.
  • Seems exacerbated when multiple side-effects (exec, file write, text reply) happen within a single assistant turn.
  • Not reliably reproducible on every tool call — flaky by nature.
  • No error logs visible client-side.

extent analysis

TL;DR

The issue can be temporarily resolved by restarting the Gateway, but a more permanent fix may involve addressing a potential race condition in the websocket delivery mechanism.

Guidance

  • Investigate the websocket delivery code for potential race conditions, especially when handling multiple side-effects within a single assistant turn.
  • Verify that the issue is indeed related to the websocket delivery by checking the network traffic and websocket messages for any signs of duplication or merging.
  • Consider adding logging or debugging statements to the websocket delivery code to gain more insight into the issue.
  • Look into the exec and write tool commands to see if they are causing any unexpected side-effects that could be contributing to the issue.

Example

No code snippet can be provided without more information about the specific websocket delivery mechanism used in the OpenClaw version 2026.4.26.

Notes

The issue's flaky nature and lack of error logs make it challenging to pinpoint the exact cause. The fact that restarting the Gateway temporarily resolves the issue suggests that the problem might be related to the Gateway's state or caching.

Recommendation

Apply a workaround, such as implementing a deduplication mechanism for websocket messages or adding a delay between tool calls to reduce the likelihood of race conditions, until a more permanent fix can be found.

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…

FAQ

Expected behavior

Each user message and each assistant reply should appear exactly once, in correct order, without duplication or merging.

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 [Bug]: WebChat duplicate/collapsed messages after tool calls [3 comments, 3 participants]