Repository navigation
fix(ui): reload WebChat history for deferred thinking - #91810
TurboTheTurtle wants to merge 6 commits into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 5:15 PM ET / 21:15 UTC. Summary PR surface: Source +85, Tests +492. Total +577 across 6 files. Reproducibility: yes. at source level. Current main skips history reload for renderable text-only finals while WebChat renders reasoning from the displayed message, so persisted thinking can remain hidden until a manual refresh. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this PR or an equivalent narrow fix after maintainer review of the WebChat session/message ordering risk, then close the linked regression issue once the fix reaches main. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main skips history reload for renderable text-only finals while WebChat renders reasoning from the displayed message, so persisted thinking can remain hidden until a manual refresh. Is this the best way to solve the issue? Yes. This is the narrowest maintainable fix I found: track only thinking-bearing deferred session messages and reload only when the terminal final lacks that thinking, rather than restoring unconditional final reloads that current code avoids for flicker reasons. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b885c81479d0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +85, Tests +492. Total +577 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Latest fix pushed at Fix update:
Validation:
Current-head browser proof: {
"head": "f68625750c83ef3eeb08fee396801b28e474fab3",
"workingTreeStatus": "clean",
"scenario": "WebChat deferred session.message thinking followed by timestamped terminal final payload without thinking",
"browser": "Playwright Chromium",
"sessionKey": "main",
"activeSessionReasoningLevel": "low",
"activeSessionThinkingLevel": "low",
"sessionsListRequests": 1,
"chatHistoryRequests": 2,
"finalAnswerCount": 1,
"reasoningCount": 1,
"thinkingBlockCount": 1,
"observedFinalText": "Final answer proof marker 91810",
"observedReasoningText": "private reasoning proof marker 91810",
"screenshotPath": "/Users/andy/openclaw-91810/.artifacts/pr-91810-proof/webchat-deferred-reasoning-current-head.png"
} |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing because the current Control UI refactor already handles the deferred terminal history reload in the new chat-state path. Rebasing this older implementation would duplicate behavior on obsolete UI modules. Leaving #91727 open for any remaining current-main verification. |
Fixes #91727.
Summary
WebChat now keeps a deferred persisted assistant
session.messagewith thinking/reasoning pending while the local run is active, then reloads the selected transcript after the terminal final when that final payload only contains renderable answer text. The repaint restores the persisted reasoning block without a manual browser refresh and avoids leaving a duplicate text-only final.Root cause
The terminal final path avoided
loadChatHistory()whenever the final carried renderable assistant text. A priorsession.messagecould already contain the persisted assistant message with a thinking block, but a session-row refresh could clear the local run before the final arrived. The final was then appended as a text-only assistant message and the UI could keep both the persisted reasoning final and the live text-only final.What changed
session.messagepayloads for the selected/equivalent session while a WebChat run is active.chatevent, instead of letting the session-row refresh clear the run early.Real behavior proof
Behavior or issue addressed: WebChat receives a persisted assistant
session.messagewith athinkingblock during an active run, then receives a terminalchatfinal payload that only contains renderable final text. The fixed behavior is that WebChat reloads the selected transcript, renders the persisted reasoning block, and does not leave a duplicate text-only final answer bubble.Real environment tested: Local OpenClaw source checkout at PR head
f68625750c83ef3eeb08fee396801b28e474fab3on macOS. The repo Control UI ran through the Vite e2e server and the actual WebChat renderer ran in Playwright Chromium. The browser connected to a gateway-shaped WebSocket endpoint with the selected session row loaded asreasoningLevel: "low".Exact steps or command run after this patch:
Evidence after fix: Copied live browser proof output from the command above:
{ "head": "f68625750c83ef3eeb08fee396801b28e474fab3", "workingTreeStatus": "clean", "scenario": "WebChat deferred session.message thinking followed by timestamped terminal final payload without thinking", "browser": "Playwright Chromium", "sessionKey": "main", "activeSessionReasoningLevel": "low", "activeSessionThinkingLevel": "low", "sessionsListRequests": 1, "chatHistoryRequests": 2, "finalAnswerCount": 1, "reasoningCount": 1, "thinkingBlockCount": 1, "observedFinalText": "Final answer proof marker 91810", "observedReasoningText": "private reasoning proof marker 91810", "screenshotPath": "/Users/andy/openclaw-91810/.artifacts/pr-91810-proof/webchat-deferred-reasoning-current-head.png" }Observed result after fix: The WebChat DOM contained exactly one
Final answer proof marker 91810, exactly oneprivate reasoning proof marker 91810, and exactly one.chat-thinkingblock. The rendered assistant bubble contained the persisted reasoning block plus the final answer; the text-only terminal final did not remain as a duplicate.What was not tested: I did not run a live external provider WebChat session because the reported bug is the Control UI/gateway event ordering after the provider has already produced a persisted assistant message. The browser proof exercises the real WebChat renderer and gateway message path without provider credentials.
Validation
Result: 3 files passed, 199 tests passed.
Result: 1 file passed, 67 tests passed.
Result: passed.
Result: all matched files use the correct format.
Result: no whitespace errors.
Commit author verification: