Repository navigation
fix(ui): steer messages jump into the middle of an active run, then disappear - #165535
Conversation
Keep dispatched steers visible once until their canonical transcript copy arrives, including queued custody, retries, history refreshes, and pane remounts. Preserve the causal order of live tools and streamed text through terminal reconciliation. Persist native assistant prefixes before steering and save only subsequent text afterward. Track committed segments per mirror candidate so changed completion identities, repeated steering, and partial-write retries cannot lose or duplicate the continuation. Reuse the existing transcript schema and app submission owner. Cover the queue-strip action, cached projection recovery, stream ordering, and native transcript persistence with focused regressions.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 7:55 AM ET / 11:55 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR keeps steering messages below already-visible chat output, retains their display until saved copies arrive, and persists Codex assistant text separately before and after steering. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main. No blocking correctness defect was identified in the pinned patch or its E2E follow-up. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI combines live agent output, pending user messages, and saved conversation history. The Codex plugin translates native events into that history, so both owners must preserve the same message order. flowchart TD
A[User steers active chat] --> B[Retained user message]
C[Live text and tools] --> D[Recorded steering boundary]
B --> D
E[Codex native events] --> F[Transcript persistence]
F --> G[Saved message receipt]
D --> H[Ordered chat transcript]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +314, Tests +1005, Docs 0. Total +1319 across 26 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one submission display owner and one transcript persistence owner, with explicit causal boundaries preserving conversation order. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the current-main mechanisms, and the supplied before screenshots show the ordering failure. This review did not execute a failing reproduction. Is this the best way to solve the issue? Yes, the patch repairs the existing display and persistence owners, preserves their reconciliation contracts, and adds regressions for distinct lifecycle and persistence failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5449de6efa13. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Keep failed-ACK ownership coverage aligned with the dispatched steer boundary. The existing prefix remains visible above the Retry row, while the continuation renders below it and Stop retains the original run target.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
c108ae6 (#165535) intentionally stopped retiming materialized stream text because causal user intervals own placement and retiming reorders live tools. The old synthetic timestamp expectation caused the two UI reds in hourly 37312031958; the later injected-note fix is unrelated. Keep the strict original timestamp and message/cleanup assertions, and assert the actual rendered prompt/reply order under disagreeing clocks. Share repeated rendering setup locally so every case and assertion fits within the existing line cap. Production behavior is unchanged. Validation: before/after in the failing file; all 85 cases in both runner configurations; five Linux repetitions; full root UI (1,477 files) and UI package (1,647 files) configs on Testbox. Types, formatting, normal and boundary lint, and P2 passed. Check-changed's three production and eight full-tree unused-export findings reproduced identically without the patch; all other changed checks passed on Linux. No new skips or baseline changes.
…isappear (openclaw#165535) * fix(ui): keep steer messages below already-visible run output Keep dispatched steers visible once until their canonical transcript copy arrives, including queued custody, retries, history refreshes, and pane remounts. Preserve the causal order of live tools and streamed text through terminal reconciliation. Persist native assistant prefixes before steering and save only subsequent text afterward. Track committed segments per mirror candidate so changed completion identities, repeated steering, and partial-write retries cannot lose or duplicate the continuation. Reuse the existing transcript schema and app submission owner. Cover the queue-strip action, cached projection recovery, stream ordering, and native transcript persistence with focused regressions. * test(ui): expect continuation below failed steer Keep failed-ACK ownership coverage aligned with the dispatched steer boundary. The existing prefix remains visible above the Retry row, while the continuation renders below it and Stop retains the original run target.
c8d7c87 (openclaw#165535) intentionally stopped retiming materialized stream text because causal user intervals own placement and retiming reorders live tools. The old synthetic timestamp expectation caused the two UI reds in hourly 37312031958; the later injected-note fix is unrelated. Keep the strict original timestamp and message/cleanup assertions, and assert the actual rendered prompt/reply order under disagreeing clocks. Share repeated rendering setup locally so every case and assertion fits within the existing line cap. Production behavior is unchanged. Validation: before/after in the failing file; all 85 cases in both runner configurations; five Linux repetitions; full root UI (1,477 files) and UI package (1,647 files) configs on Testbox. Types, formatting, normal and boundary lint, and P2 passed. Check-changed's three production and eight full-tree unused-export findings reproduced identically without the patch; all other changed checks passed on Linux. No new skips or baseline changes.
What Problem This Solves
Fixes: a steer message sent during an active run shows up in the middle of the transcript (above tool activity and text that were already visible), then disappears before its saved copy arrives.
User Impact
User impact: a steer moves once from the queue to the bottom of the transcript when delivery starts and stays there until its saved copy replaces it. Everything that was already visible stays above it, new output appears below it, and that order survives history refreshes, reconnects, pane remounts, and reloading a finished run, including when a streamed answer spans the steer.
Why This Change Was Made
Three independent defects produced the reported behavior:
chat-thread-build.ts, so timestamp placement reorderedtool -> answer -> steerintoanswer -> steer -> tool. When a steer is delivered, every live tool of that run that is already visible is now closed before it (closeToolStreamBoundaryintool-stream-state.ts), tools that start afterward record the steer as their lower boundary, and the thread builder prefers those recorded boundaries; stream reconciliation keeps them through history and terminal reconciliation.event-projector-steering.ts). The transcript mirror tracks committed segments per candidate so a changed completion identity, raw completions, repeated steering, and partial-write retries cannot drop or duplicate the continuation. Existing transcript tables and columns; no schema change.Evidence
Mocked Control UI e2e (dark theme, 1200x900): an active run with visible Read activity and streamed text, then the steer "take over vince's work too" is delivered. Fixture data only; the throwaway capture test was not committed. "Before" ran the same capture with
origin/mainproduction files.Before, live (steer lands above the already-visible Read activity):
After, live (steer at the bottom):
Before, after history refresh (wrong order persists):
After, after history refresh (order survives):
Regression tests (each failed on
origin/mainbefore the fix),pnpm test <file> --maxWorkers=1:ui/src/pages/chat/chat-steer-order.test.ts(new)ui/src/pages/chat/chat-queue-steer-lifecycle.test.ts(new)ui/src/pages/chat/chat-send-handoff.test.tsextensions/codex/src/app-server/event-projector-snapshot.test.tsextensions/codex/src/app-server/run-attempt.steering.test.tsextensions/codex/src/app-server/transcript-mirror.test.tsWall times are from a heavily loaded host; the new UI tests are pure state/projection tests (no real timers, no Gateway boot). The native steering cases reuse the existing suite fixture.
Gates:
pnpm tsgo:ui,pnpm tsgo:extensions, oxfmt and oxlint on touched files,git diff --check. Independent Codex autoreview: scoped-clean.Limits: proof uses mocked Gateway/native events plus real SQLite persistence; no live provider run. Docs updated in
docs/web/control-ui/chat.md.Landing CI follow-up
The first CI attempt at
6f0094d03ab4exposed a stale UI E2E expectation: after a failed steer ACK, the already-visible prefix remains above the Retry/Discard row and the continuation appears below it. Both fragments remain visible. The assertion now checks the continuation separately and retains the original draft, active-response, and Stop-target checks. The focused two-case E2E passes with--maxWorkers=1(18.52s wall time; 4.961s test time). The original CI failure took 33.35s in that case before its 30s locator timeout. No production behavior changed in this follow-up.The same run also failed three cases in
extensions/codex/src/app-server/run-attempt-thread-cleanup.test.ts: the confirmed indeterminate-turn case and both terminal-cleanup cancellation cases expected nothread/unsubscribe. These failures are inherited from main: commit4c34d8eeadfc(#165487) changed required subscription cleanup to use the resource cleanup authority. The test and cleanup owner are unchanged by this PR. Running the original five-file CI selection with two workers reproduced exactly three failures and 42 passes on both the PR and clean main2795ad9d0e03(157.41s and 232.85s, respectively). Main's cleanup source is unchanged from the tested CI base6b37a39aa104. This is failure attribution, not passing CI.The correction is published as
f953e34d63f6and its independent Codex autoreview is scoped-clean. Exact-head CI 37305321004 passed the affected UI E2E shard andsecurity-fast. Its only root failure is the same three inherited cleanup assertions;openclaw/ci-gatefailed downstream and the successful fail-fast monitor cancelled 23 jobs. Final job conclusions: 14 successful, 2 failed, 23 cancelled, 22 skipped. Landing uses the native inherited-failure admin exception with the exact tested merge, baseline reproduction, failure logs, and exhaustive cancellation attribution. Cancelled coverage remains unrun. No CI rerun was requested.