Repository navigation
Conversation
Restore chatRunId/chatStream from chat.history inFlightRun when switching back to a running session, matching existing TUI behavior. Fixes openclaw#90755 Co-authored-by: Cursor <[email protected]>
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: the valid Control UI reconnect bug remains owned by the canonical open issue, while this PR repeats the direct cumulative Canonical path: Keep #90755 as the canonical owner for a gateway/history contract that exposes or reconciles only the unpersisted active-run portion, with proof attached outside the repo branch. So I’m closing this here and keeping the remaining discussion on #90755. Review detailsBest possible solution: Keep #90755 as the canonical owner for a gateway/history contract that exposes or reconciles only the unpersisted active-run portion, with proof attached outside the repo branch. Do we have a high-confidence way to reproduce the issue? Yes. The bug is source-reproducible: current main exposes Is this the best way to solve the issue? No. This PR is not the best fix because it assigns the cumulative in-flight buffer directly; the safer solution is the maintainer-requested canonical unpersisted active-run contract or reconciliation helper. Security review: Security review cleared: No concrete security or supply-chain concern was found; the diff does not touch dependencies, workflows, permissions, secrets, or executable install paths. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 66079161d72a. |
|
CI babysit update
Remaining blocker (not CI): ClawSweeper |
Playwright capture showing inFlightRun restore after session switch-back. Co-authored-by: Cursor <[email protected]>
|
@clawsweeper re-review Added real Control UI browser proof (Playwright + Edge, mock Gateway After fix — session switch-back restores buffered assistant text + in-progress indicator: Before — only committed user message after initial load: Runtime state after switch-back: { "chatRunId": "run-proof-90755", "chatStream": "still working in the background…" }PR body updated with capture steps. Local repro: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
What problem does this PR solve?
Why does this matter now?
What is the intended outcome?
chat.historyinFlightRuncontract (already used by TUI) on history reload, rehydratingchatRunId/chatStreamso partial assistant text or a reading indicator appears after switch-back.What is intentionally out of scope?
What does success look like?
loadChatHistory, when the gateway reports an in-flight run, the Control UI shows buffered assistant text or a reading indicator and continues receiving live deltas for that run.What should reviewers focus on?
ui/src/ui/controllers/chat.ts(adoptInFlightRunFromChatHistory+ call site after stream reset)ui/src/ui/controllers/chat.test.ts(loadChatHistory inFlightRun adoption)Linked context
Which issue does this close?
Closes #90755
Which issues, PRs, or discussions are related?
Related #90755 (ClawSweeper queueable-fix / fix-shape-clear / source-repro)
Was this requested by a maintainer or owner?
inFlightRunin Control UI, mirror TUI.Real behavior proof (required for external PRs)
inFlightRunfromchat.historyon session switch-back.fix/issue-90755-inflight-run; Playwright + Edge driving Control UI E2E harness (startControlUiE2eServer) with mock Gatewaychat.historyreturninginFlightRun.Browser repro steps (mock gateway, real Control UI DOM):
01-chat-before-switch-back.png).chat.historyresolves withinFlightRun: { runId: "run-proof-90755", text: "still working in the background…" }.02-chat-after-inflight-restore.png).{ "chatRunId": "run-proof-90755", "chatStream": "still working in the background…", "visibleInDom": "still working in the background…" }Screenshots (committed under
proof/pr-90755/on this branch):Before switch-back:
proof/pr-90755/01-chat-before-switch-back.pngAfter
inFlightRunadoption:proof/pr-90755/02-chat-after-inflight-restore.pngObserved result after fix: After session switch-back, Control UI renders buffered assistant text (
still working in the background…) and shows the in-progress/streaming state instead of appearing idle with only the user message.What was not tested: Live gateway + real agent streaming run; active tool-call replay mid-run.
Proof limitations or environment constraints: Mock Gateway supplies
inFlightRun(same contract as productionchat.history); browser is local Edge via Playwright. Not reporter's production Control UI instance.Before evidence (optional but encouraged):
01-chat-before-switch-back.png— Session A after initial load shows only the committed user message, no in-progress assistant bubble.Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs ui/src/ui/controllers/chat.test.ts— 119 passednode scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts— 65 passednode scripts/run-vitest.mjs ui/src/ui/app-gateway.node.test.ts— 104 passedpnpm oxfmt --check ui/src/ui/controllers/chat.test.ts ui/src/ui/controllers/chat.ts— passpnpm check:test-types— passWhat regression coverage was added or updated?
loadChatHistory inFlightRun adoption— buffered text restore + empty-text reading-indicator adoption.What failed before this fix, if known?
chatRunIdstayed null after history reload despite gatewayinFlightRunpayload.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Returning to a running session now shows in-progress assistant output instead of appearing idle.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
How is that risk mitigated?
Current review state
What is the next action?
proof/pr-90755/). Await ClawSweeper re-review / maintainer merge.What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?
status: needs proof— added Control UI browser screenshots + Playwright capture (scripts/capture-proof-90755.mts, local-only).