Bug Description
Agent responses disappear from the webchat UI after heartbeat tool calls arrive. The response is initially rendered correctly, but gets displaced when a subsequent heartbeat turn triggers tool execution.
Steps to Reproduce
- Send a request to the agent that triggers tool calls (e.g., file reads)
- Agent responds with a complete, multi-part answer — renders correctly in webchat
- Do NOT interact further — wait for the next heartbeat poll to fire automatically
- Heartbeat generates a turn with its own tool calls (e.g., checking file existence)
- The heartbeat tool-call bubble appears in the UI
- Previous agent responses disappear — only the first response (before any tool calls) remains visible
Key Observations
- The response was fully visible before the heartbeat arrived — this is not a "never rendered" case, but a "rendered then displaced" case
- The model (MiMo V2 Pro) also repeated the same evaluation 3 times instead of marking the turn as complete — possibly related, as the model may not be cleanly ending its turn, causing the UI to treat subsequent heartbeats as part of the same conversation flow
- This is model-specific: did not occur with Claude Opus 4.7 or Gemini 3.1 Pro under the same workflow and same gateway instance
- Messages are preserved in the Gateway (confirmed by reading session context) — this is purely a UI rendering issue
Root Cause Hypothesis
This appears to be related to the runId mismatch / full history replacement issues identified in #37083:
- The heartbeat tool-call events may trigger a full history replacement (
Jn() function) that discards the previous assistant messages
- If the model doesn't emit a clean turn-end signal, the UI may treat the heartbeat as a continuation of the same run rather than a new turn, causing the runId mismatch logic to drop messages
Workaround
Page refresh restores all messages (they are preserved in the Gateway).
Environment
- OpenClaw: 2026.5.2
- OS: Windows 10 (10.0.19045, x64)
- Channel: webchat (openclaw-control-ui)
- Model: xiaomi/mimo-v2-pro
- Heartbeat model: google/gemini-3-flash-preview
Related Issues
Bug Description
Agent responses disappear from the webchat UI after heartbeat tool calls arrive. The response is initially rendered correctly, but gets displaced when a subsequent heartbeat turn triggers tool execution.
Steps to Reproduce
Key Observations
Root Cause Hypothesis
This appears to be related to the runId mismatch / full history replacement issues identified in #37083:
Jn()function) that discards the previous assistant messagesWorkaround
Page refresh restores all messages (they are preserved in the Gateway).
Environment
Related Issues