Skip to content

[Bug] WebChat/Control UI: WebSocket messages not pushed to frontend, requires refresh to see output #38888

@tociyou1995

Description

@tociyou1995

Problem

When using WebChat/Control UI, the AI is processing and generating output on the backend, but the frontend does not receive/display the streamed output. Only after manually refreshing the browser does the output appear immediately.

Symptoms

  1. Frontend not updating: User sends a message, AI is thinking and generating output (confirmed by logs), but the UI shows nothing
  2. Refresh reveals output: When user refreshes the browser, the output appears immediately (it was already there)
  3. Message truncation/loss: Sometimes messages are truncated or lost entirely
  4. Message misalignment: AI sometimes responds to a previous message instead of the current one
  5. WebSocket terminated: WebChat connection randomly disconnects

Environment

  • OpenClaw version: 2026.3.2
  • Platform: WSL2 on Windows
  • Access: Control UI at http://127.0.0.1:18789/
  • Network: Tested with and without Clash proxy, problem persists in both cases

Log Evidence

21:25:46 [health-monitor] restarting (reason: stale-socket)
21:26:49 agent end: isError=true error=terminated
21:12:55 webchat disconnected code=1001 reason=n/a

The stale-socket issue occurs approximately every 30 minutes.

Root Cause Analysis

The issue appears to be related to WebSocket message push, not network connectivity:

Component Status
Backend processing ✅ Working (AI is generating output)
WebSocket connection ✅ Exists
Message push to frontend ❌ Not working correctly

Steps to Reproduce

  1. Open Control UI at http://127.0.0.1:18789/
  2. Send a message to the AI
  3. Observe: AI is processing (visible in logs) but UI shows nothing
  4. Refresh browser
  5. Output appears immediately

Related Issues

Frequency

Intermittent, but occurs multiple times per session. Makes normal usage very difficult.


Thanks for looking into this! 🦞

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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