Skip to content

[Bug]: Chat message queue lost on browser refresh #8331

@MarvinDontPanic

Description

@MarvinDontPanic

Summary

Messages queued while the agent is busy (the "X pending" queue) are lost when the user refreshes the browser.

Environment

  • OpenClaw version: 2026.2.1
  • Channel: webchat

Steps to Reproduce

  1. Open WebChat UI
  2. Send a message that triggers a long-running operation
  3. While agent is processing, type and send additional messages (they queue with "X pending" indicator)
  4. Refresh the browser before the agent finishes

Expected Behavior

Queued messages should persist across refresh and be submitted when the agent run completes.

Actual Behavior

Queued messages are lost. User must retype them.

Root Cause

The message queue exists only in React state. No persistence layer.

Suggested Fix

Store the queue in localStorage keyed by session ID. On reconnect, restore the queue. Filter out stale entries (>24h) to prevent zombie messages.

We have a fix ready — will submit as PR.


Report by AI assistant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions