mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:30:43 +00:00
When a user sends a message, the Control UI performs an optimistic update to
display the message immediately. However, if a session.message gateway event
arrives during the send, it triggers an unconditional loadChatHistory() call.
This race condition resets chatStream to null, causing the optimistic message
card to disappear until the first LLM delta arrives.
The fix adds a guard to skip history reload while a chat run is active
(host.chatRunId is set). The chat event handler already manages streaming state
and appends the final assistant message, making the concurrent reload unnecessary
during active sends. External message refresh is preserved for idle sessions.
Fixes the regression introduced in commit 20266c14cb (added session.message
event handling for qa-lab testing).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>