openclaw - ✅(Solved) Fix [Bug]: Control UI — queued message silently lost when switching to another session [1 pull requests, 1 comments, 2 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#73621Fetched 2026-04-29 06:17:20
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
cross-referenced ×2commented ×1

When a message is in queued state in the Control UI (waiting for an active run to finish), navigating to a different session causes that message to disappear silently — it never gets processed and leaves no trace in the transcript.

Error Message

Actual: Message B has disappeared — not in the transcript, not processed, no error shown.

Root Cause

Root Cause Hypothesis

Fix Action

Fixed

PR fix notes

PR #73679: fix(ui): preserve queued chat messages across session switches

Description (problem / solution / changelog)

Summary

  • Problem: Control UI queued chat messages were stored only in the active chatQueue and were cleared when switching sessions.
  • Why it matters: A queued follow-up could silently disappear if the user navigated away before the active run finished.
  • What changed: Queue state is now preserved per session and restored when switching back; overview session switching uses the same session-switch helper.
  • What did NOT change (scope boundary): This does not persist queued messages to the gateway or disk; it preserves the existing client-side queue across in-UI session navigation.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #73621
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: resetChatStateForSessionSwitch() unconditionally cleared state.chatQueue, even when the queue belonged to the session being left.
  • Missing detection / guardrail: Existing session-switch tests checked reset behavior but did not assert queued message preservation.
  • Contributing context (if known): Queued messages are client-side until flushed, so clearing local queue state drops them silently.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: ui/src/ui/app-render.helpers.node.test.ts
  • Scenario the test should lock in: Queue a message in one session, switch away, then switch back and confirm the queued item is restored.
  • Why this is the smallest reliable guardrail: The bug is in session-switch state reset logic, so a focused helper test covers the failure directly.
  • Existing test that already covers this (if any): N/A
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Queued Control UI messages remain associated with their original session when navigating to another session and are visible again when returning.

Changed files

  • ui/src/ui/app-render.helpers.node.test.ts (modified, +51/-1)
  • ui/src/ui/app-render.helpers.ts (modified, +21/-1)
  • ui/src/ui/app-render.ts (modified, +1/-14)
  • ui/src/ui/app-view-state.ts (modified, +2/-1)
  • ui/src/ui/app.ts (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Summary

When a message is in queued state in the Control UI (waiting for an active run to finish), navigating to a different session causes that message to disappear silently — it never gets processed and leaves no trace in the transcript.

Steps to Reproduce

  1. Open a session in the Control UI webchat
  2. Send message A → it starts processing (agent run active)
  3. While message A is still processing, send message B → it shows as queued
  4. Switch to a different session in the Control UI
  5. Switch back to the original session

Expected: Message B is still visible and gets processed after message A finishes. Actual: Message B has disappeared — not in the transcript, not processed, no error shown.

Environment

  • OpenClaw version: 2026.4.26
  • Channel: webchat (Control UI)
  • Browser: Chrome

Root Cause Hypothesis

The "queued" state appears to be client-side only (optimistic rendering). When the user navigates away, the WebSocket context for that session is likely torn down before the queued message is durably committed to the gateway. The gateway never receives it.

Related Issues

  • #45952 — messages lost on WebSocket reconnect (related but different trigger)
  • #51549 — message queue lost on browser refresh (related but different trigger)

Impact

Any queued follow-up message sent while an agent is running is silently dropped if the user navigates to another session — no feedback, no retry, no persistence.

extent analysis

TL;DR

Implementing durable storage for queued messages on the client-side or ensuring the WebSocket context persists across session switches may prevent messages from being silently dropped.

Guidance

  • Investigate the WebSocket connection teardown process when switching sessions to determine if it's possible to maintain the context or delay disconnection until pending messages are committed.
  • Consider implementing a client-side message queue with durable storage (e.g., local storage or IndexedDB) to store messages before they are sent to the gateway, allowing for retry or re-submission when the session is re-established.
  • Review related issues (#45952 and #51549) to identify potential patterns or solutions that could be applied to this scenario.
  • Verify that the issue is specific to the Control UI webchat and Chrome browser, or if it occurs across different environments and browsers.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The root cause hypothesis suggests a client-side issue related to optimistic rendering and WebSocket context teardown. However, without further information on the implementation, it's challenging to provide a definitive solution.

Recommendation

Apply a workaround, such as implementing client-side durable storage for queued messages, as it appears to be a more feasible and immediate solution to prevent message loss.

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 - ✅(Solved) Fix [Bug]: Control UI — queued message silently lost when switching to another session [1 pull requests, 1 comments, 2 participants]