Skip to content

[webchat] Agent responses disappear after heartbeat tool calls (model-specific, MiMo V2 Pro) #76654

Description

@KurtWoloch

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

  1. Send a request to the agent that triggers tool calls (e.g., file reads)
  2. Agent responds with a complete, multi-part answer — renders correctly in webchat
  3. Do NOT interact further — wait for the next heartbeat poll to fire automatically
  4. Heartbeat generates a turn with its own tool calls (e.g., checking file existence)
  5. The heartbeat tool-call bubble appears in the UI
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions