Skip to content

[Bug]: Webchat UI stuck in "thinking/in progress" state after LLM response completes #84041

@waterliu1981

Description

@waterliu1981

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

After the LLM response is fully generated and displayed, the webchat left panel remains stuck in "thinking/in progress" state and never transitions to "done".

Steps to reproduce

  1. Send a message in the webchat Control UI channel
  2. Wait for the LLM to generate and display the full response in the chat area
  3. Observe the left panel still shows "Thinking..." animation and "Calling model via HTTP API"
  4. The status never changes to "done" — it persists indefinitely

Expected behavior

After the LLM response is fully displayed, the left panel should transition from "thinking" to "done" state, and the context length indicator bar should refresh.

Actual behavior

The left panel remains stuck showing "Thinking..." with the animated spinner and "Calling model via HTTP API" text even after the response is complete. The context length indicator bar does not refresh. The status occasionally resolves on its own after a delay, or after sending a new message.

OpenClaw version

2026.5.18

Operating system

macOS 15 (Darwin 25.5.0, arm64)

Install method

npm global

Model

custom/qwen3.6-35b-a3b-8bit(mlx)

Provider / routing chain

custom local provider

Additional provider/model setup details

Image

Logs, screenshots, and evidence

Impact and severity

Affected users: Single-user webchat users
Severity: Medium (does not block functionality, but creates confusion as users cannot tell if the agent is still working)
Frequency: Recurring — observed multiple times in current session
Consequence: Users must manually refresh the page or send another message to clear the stuck state

Additional information

Root cause analysis via frontend code inspection (control-ui/assets/index-quv2B8bV.js):

The webchat frontend uses several state variables to track turn status:

  • chatLoading: Set to true when chat request begins
  • chatRunStatus: Tracks turn phase (pending → thinking → done/interrupted)
  • chatStream: Holds the current chat stream state

Possible failure modes:

  1. Yv() state transition function is not called with outcome: 'done' after turn completion
  2. Zv() self-check function returns false because session.hasActiveRun or status data is stale
  3. WebSocket sessions.subscribe event (sessions.patch/sessions.update) is delayed or dropped
  4. chatRunId is set but never cleared by completion event

Key functions in the minified bundle:

  • Ex() — chat request handler (sets chatLoading = true)
  • Yv() — state transition function (should set chatRunStatus phase to 'done')
  • Zv() — turn completion self-check
  • Gv() — auto-clear timer (5 seconds)
  • Wv() — status clear function
  • iS() — sessions.subscribe WebSocket handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    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