openclaw - 💡(How to fix) Fix [Bug]: Chat history disappears from control UI on re-render — only most recent message reappears

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…

Chat history periodically vanishes from the webchat UI. After the history clears, only the most recent message reappears. All prior messages are gone until page reload. Backend session is unaffected — messages are received and processed correctly.

Root Cause

Chat history periodically vanishes from the webchat UI. After the history clears, only the most recent message reappears. All prior messages are gone until page reload. Backend session is unaffected — messages are received and processed correctly.

RAW_BUFFERClick to expand / collapse

Summary

Chat history periodically vanishes from the webchat UI. After the history clears, only the most recent message reappears. All prior messages are gone until page reload. Backend session is unaffected — messages are received and processed correctly.

Steps to Reproduce

  1. Open chat at 127.0.0.1:18789
  2. Exchange several messages
  3. Send another message (or wait for a re-render trigger)
  4. Prior chat history disappears — only the latest message is visible

Expected: Full chat history remains visible Actual: History clears, only most recent message shown

Details

  • Backend session confirmed healthy (0 compactions, 26k/200k context used at time of occurrence)
  • No JavaScript errors in browser console when history disappears
  • No failed network requests visible in Network tab
  • The 101 WebSocket connection entry is present and healthy
  • Bug is intermittent — triggered by re-render events (possibly WebSocket reconnect or focus/blur)
  • Suspected cause: on reconnect/re-render, the UI fetches only the last turn instead of full session history

Notes

  • Bug pre-dates OpenClaw reinstall on 2026-04-19 — this is a pre-existing issue in the control UI, not a regression
  • Text messages and image messages both affected equally

Environment

  • OpenClaw 2026.4.15 (041266a)
  • Chrome 147.0.0.0 on macOS
  • URL: 127.0.0.1:18789/chat?session=main

extent analysis

TL;DR

The most likely fix involves modifying the UI to fetch the full session history instead of only the last turn when reconnecting or re-rendering.

Guidance

  • Investigate the WebSocket reconnect and re-render events to determine why the UI is only fetching the last turn instead of the full session history.
  • Verify that the backend is sending the full session history when requested, and that the issue is not due to a limitation in the backend API.
  • Check the UI code for any caching or optimization mechanisms that might be causing the chat history to be cleared unnecessarily.
  • Consider adding logging or debugging statements to track the flow of data between the backend and UI to identify where the issue is occurring.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The issue seems to be related to the UI's handling of WebSocket reconnects and re-renders, and may require changes to the UI code to fix. The fact that the backend session is unaffected and no JavaScript errors are reported suggests that the issue is likely specific to the UI.

Recommendation

Apply a workaround to modify the UI to fetch the full session history when reconnecting or re-rendering, as the root cause of the issue is likely related to this behavior.

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…

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]: Chat history disappears from control UI on re-render — only most recent message reappears