Repository navigation
fix(ui): keep assistant messages intact while tools run - #146554
Conversation
|
🦞👀 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 September 12, 2026, 11:01 PM ET / September 13, 2026, 03:01 UTC (Revision 6). ClawSweeper reviewWhat this changesThe Control UI keeps assistant messages growing continuously during tool activity and updates regression coverage for commentary, reconnects, and grouped tools. Merge readiness✅ Ready for maintainer review This fix remains necessary: current main still splits live assistant text when tool entries arrive. No blocking defect was found in the pinned patch; the earlier merged commentary fixes address different event-ordering problems. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI turns Gateway chat and tool events into the browser transcript. Its stream reconciliation combines live text with persisted messages while preserving message and user-turn boundaries. flowchart TD
A[Gateway events] --> B{Event kind}
B --> C[Assistant text stream]
B --> D[Tool activity cards]
B --> E[Persisted messages and user boundaries]
E --> F[Stream reconciliation]
C --> F
F --> G[Browser transcript]
D --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +117. Total +116 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep message completion and user boundaries authoritative, allowing unfinished assistant text to grow while tool activity renders independently. Do we have a high-confidence way to reproduce the issue? Yes, from source: deliver partial assistant text, a new tool event, then another cumulative text delta; current main retires the partial text at tool arrival. This review did not execute that sequence. Is this the best way to solve the issue? Yes. Removing tool arrival as a completion signal repairs the producer of the fragments while retaining existing persisted-message, commentary, and steer reconciliation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cba70dc5c0f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Retire the complete matching cumulative suffix across tool rollovers while preserving existing message and user/run ownership boundaries. Co-authored-by: VACInc <[email protected]>
Worked on by: - @VACInc Co-authored-by: VACInc <[email protected]> OpenClaw-Publication: 0d5cfee0-9590-49c6-9e80-1a143ece559a
Remove publication-only line-ending normalization; the complete tree matches the reviewed commentary fix. Co-authored-by: VACInc <[email protected]>
c593ed2 to
9252dc0
Compare
|
@clawsweeper re-review Added source-backed Stored-data compatibility proof to the PR body addressing the remaining question: retirement indexes are function-local; the live segment type, explicit message materialization, snapshot schema/writer, and IndexedDB version are unchanged. No migration or cache reset is needed. Please reassess the stored-data classification against those cited owners. The two requested captioned before/after videos were delivered in the linked team session and demonstrate continued incremental answer streaming. GitHub binary uploads return HTTP400 Bad Content-Length and the approved artifact-store fallback returns HTTP403 SignatureDoesNotMatch, so public media upload remains explicitly unverified. All UI CI jobs passed on the previous head. Its sole underlying failure was the unrelated 702/700 shard-root budget. Refreshed head9252dc0ce8265963c8b28f80f656a8424aca8896 incorporates mainline #146538; the failed headroom test and191 UI tests now pass locally. The commentary patch is byte/patch-equivalent; fresh exact-head CI is pending. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Replace the cleanup-only repair with message-owned stream boundaries. Tool starts, updates, results, and replay no longer split a live assistant message. Preserve completed messages through their existing durable owners. Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review The reporter correctly rejected the previous cleanup-only patch. New head The new regressions and replacement before/after videos check the unfinished sentence after every delta/tool event, not only eventual cleanup. 262 tests, UI typecheck, lint, and fresh independent review pass. The PR body records the provisional placement tradeoff and video-upload transport limitation. Please review this replacement, not the withdrawn cleanup-only implementation. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Keep the reconnect response live, send cumulative streaming snapshots, and expand grouped activity before verifying the unchanged 50-tool eviction limit. Co-authored-by: VACInc <[email protected]>
|
@clawsweeper re-review Head a05c749 contains test-only CI corrections; the reviewed production fix and video behavior are unchanged. Reconnect coverage now asserts continued live text, the browser fixture sends a cumulative snapshot, and the runtime-budget test expands the actual activity disclosure before enforcing the unchanged 50-tool limit and eviction checks. All 47 reconnect tests, 9 streaming browser tests, and 5 runtime-budget tests pass locally; type-aware lint and independent review are clean. Fresh CI is required before the human maintainer merges; do not enable automerge. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
) * fix(ui): remove commentary fragments after asynchronous tool activity Retire the complete matching cumulative suffix across tool rollovers while preserving existing message and user/run ownership boundaries. Co-authored-by: VACInc <[email protected]> * fix(ui): remove commentary fragments after asynchronous tool activity Worked on by: - @VACInc Co-authored-by: VACInc <[email protected]> OpenClaw-Publication: 0d5cfee0-9590-49c6-9e80-1a143ece559a * chore: restore unchanged Windows wrapper bytes after publication Remove publication-only line-ending normalization; the complete tree matches the reviewed commentary fix. Co-authored-by: VACInc <[email protected]> * fix(ui): keep responses streaming through tool activity Replace the cleanup-only repair with message-owned stream boundaries. Tool starts, updates, results, and replay no longer split a live assistant message. Preserve completed messages through their existing durable owners. Co-authored-by: VACInc <[email protected]> * test(ui): align streaming and grouped-tool CI contracts Keep the reconnect response live, send cumulative streaming snapshots, and expand grouped activity before verifying the unchanged 50-tool eviction limit. Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
…7080) ## What Problem This Solves Final replies could appear twice after a mid-turn refresh or reconnect. Fixes #138735. Reported by @PanyhP. Replaces #138887 with the remaining display fix; cursor recovery is already fixed on main. ## Why This Change Was Made One item-aware matcher in `session-projection.ts` decides which display row owns a final. The other writer of this state is history replay; item identity and transcript order decide adoption. Commentary and tool continuations cannot adopt an unkeyed final. ## User Impact A final appears once after refresh or reconnect. Distinct items with equal text remain separate. ## Evidence Real Gateway and built Control UI: mid-turn refresh/reconnect changed from two final blocks to one. Completed-turn refresh stays at one. Refresh command: `bunx [email protected] --session "$session" reload`. ## Compatibility Stored transcripts, protocol fields, schemas and preferences are unchanged. Apple decoding was inspected: its inputs and independent rows are unchanged; no device run is claimed. ## Consumers Control UI and terminal UI use the shared matcher. ## Invalidation Live delivery and full-history replay share item ownership; existing reconnect and history reset rules remain. ## Tests Client: 388 passed. Display projection: 143 passed. Terminal UI: 210; Control UI: 139 passed, on the merge with main. New reducer regressions failed before the fix and pass afterward. `node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-client.config.ts packages/gateway-client/src` ## Review scope and evidence - The reviewed head is f05f513, a fresh merge of fix 6768058 with main 9746e39. - The failing browser baseline is e735dcd. Real Gateway and matching built Control UI captures show two final blocks after a mid-turn refresh or reconnect on the baseline, and one on the reviewed head. Completed-turn refresh remains one; two separate same-text replies remain two. - The 880 focused tests passed on that merge: Gateway client 388, display projection 143, terminal UI 210, and Control UI 139. Full hosted checks also passed on this head in [CI run 34762715688](https://github.com/openclaw/openclaw/actions/runs/34762715688). ## Ownership and compatibility - entryMatches in packages/gateway-client/src/session-projection.ts owns display-row adoption for live delivery and full-history replay. The existing snapshot terminal selector only narrows candidates admitted by that matcher. History, live events, pending sends, and sequenced error recovery retain their existing ordering rules. - The tool-continuation predicate also checks tool content, so missing or misleading stopReason values cannot make a tool row own an unkeyed final. The change adds 17 net production lines and 60 test lines. - The merged #146554 behavior remains: tool activity does not retire an unfinished assistant stream. Its continuous-stream and completed-message assertions still pass. - Apple clients use independent Swift row identity and do not decode display-part item IDs. This PR changes neither their code nor their received payloads and does not restore the old multi-payload broadcast. Native conclusions are source-only; no device run is claimed. - Cursor commentary recovery is already fixed on main. Stored transcripts, commentary preferences, schemas, config keys, protocol fields, and public SDK contracts are unchanged. This replaces the remaining display work in #138887. Co-authored-by: Ayaan Zaidi <[email protected]>
…nclaw#147080) ## What Problem This Solves Final replies could appear twice after a mid-turn refresh or reconnect. Fixes openclaw#138735. Reported by @PanyhP. Replaces openclaw#138887 with the remaining display fix; cursor recovery is already fixed on main. ## Why This Change Was Made One item-aware matcher in `session-projection.ts` decides which display row owns a final. The other writer of this state is history replay; item identity and transcript order decide adoption. Commentary and tool continuations cannot adopt an unkeyed final. ## User Impact A final appears once after refresh or reconnect. Distinct items with equal text remain separate. ## Evidence Real Gateway and built Control UI: mid-turn refresh/reconnect changed from two final blocks to one. Completed-turn refresh stays at one. Refresh command: `bunx [email protected] --session "$session" reload`. ## Compatibility Stored transcripts, protocol fields, schemas and preferences are unchanged. Apple decoding was inspected: its inputs and independent rows are unchanged; no device run is claimed. ## Consumers Control UI and terminal UI use the shared matcher. ## Invalidation Live delivery and full-history replay share item ownership; existing reconnect and history reset rules remain. ## Tests Client: 388 passed. Display projection: 143 passed. Terminal UI: 210; Control UI: 139 passed, on the merge with main. New reducer regressions failed before the fix and pass afterward. `node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-client.config.ts packages/gateway-client/src` ## Review scope and evidence - The reviewed head is f05f513, a fresh merge of fix 6768058 with main 11d57c2. - The failing browser baseline is 3d98f68. Real Gateway and matching built Control UI captures show two final blocks after a mid-turn refresh or reconnect on the baseline, and one on the reviewed head. Completed-turn refresh remains one; two separate same-text replies remain two. - The 880 focused tests passed on that merge: Gateway client 388, display projection 143, terminal UI 210, and Control UI 139. Full hosted checks also passed on this head in [CI run 34762715688](https://github.com/openclaw/openclaw/actions/runs/34762715688). ## Ownership and compatibility - entryMatches in packages/gateway-client/src/session-projection.ts owns display-row adoption for live delivery and full-history replay. The existing snapshot terminal selector only narrows candidates admitted by that matcher. History, live events, pending sends, and sequenced error recovery retain their existing ordering rules. - The tool-continuation predicate also checks tool content, so missing or misleading stopReason values cannot make a tool row own an unkeyed final. The change adds 17 net production lines and 60 test lines. - The merged openclaw#146554 behavior remains: tool activity does not retire an unfinished assistant stream. Its continuous-stream and completed-message assertions still pass. - Apple clients use independent Swift row identity and do not decode display-part item IDs. This PR changes neither their code nor their received payloads and does not restore the old multi-payload broadcast. Native conclusions are source-only; no device run is claimed. - Cursor commentary recovery is already fixed on main. Stored transcripts, commentary preferences, schemas, config keys, protocol fields, and public SDK contracts are unchanged. This replaces the remaining display work in openclaw#138887. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes a streaming assistant sentence breaking into fragments such as “I'll check” and “what” when tool activity arrives during the response.
User Impact
Assistant messages stay together and grow continuously while tools start, report progress, finish, or replay. Streaming is not buffered until completion. Completed messages, keyed commentary, and user/steer boundaries keep their existing owners.
Provisional placement: while persistence is catching up, tool cards can appear above the still-growing text. Once its durable message arrives, transcript order owns placement. The response is no longer cut into completed-looking fragments to position it around tools.
Why This Change Was Made
The previous revision only removed fragments after completed commentary arrived. @VACInc correctly pointed out that it left the visible in-flight bug intact. This revision withdraws that cleanup-only change and removes the source of the invalid state:
handleAgentEventno longer callsrolloverChatStreamwhen a tool entry appears. Tool execution timing does not prove an assistant message has ended, including for delayed top-level starts and history replay.No new stream manager, message identity protocol, configuration, schema, or stored-data migration is introduced. Existing persisted-assistant prefix reconciliation, keyed commentary, and persisted user boundaries remain unchanged. Production diff: +2/-3 lines.
Evidence
pnpm tsgo:ui, focused type-aware lint, formatting, andgit diff --checkpassed. Fresh independent autoreview of the staged replacement candidate is scoped-clean through P2.a05c749ca4f7b25a2bf676be3171d0b008d0b07f; exact-head CI run 34729969374, attempt 2, completed successfully. GitHub reports no failed or pending checks and a clean merge state. ClawSweeper revision 5 cleared this exact head with no blocking findings. The branch retains mainline fix: restore core test shard headroom #146538.Limits: this is deterministic browser proof, not a replay of the original production WebSocket trace. Public binary uploads are blocked by the current transport: GitHub returns HTTP 400
Bad Content-Length, and the approved artifact-store fallback returns HTTP 403SignatureDoesNotMatchwith an empty canonical content length. The videos are available in the team session; no unverified public asset URL is claimed.CI follow-up
The test-only follow-up aligns reconnect/streaming coverage with continuous messages and expands grouped activity before enforcing the unchanged 50-tool cap and eviction checks. All 47 reconnect tests and 14 browser tests pass locally; type-aware lint and independent review are clean.
The quota-readiness check was intermittent: both automatic and saved-clear cases passed on the exact failing integration revision in diagnostic run 34731210493, and the PR’s own targeted retry then passed the full real-Gateway job and aggregate gate in run 34729969374, attempt 2. No quota assertion, safeguard, or production behavior was weakened. The diagnostic run itself is not used as the PR merge gate.
Stored-data compatibility
The final production diff only removes a UI import/call and replaces its comment. It changes no serialized fields, cache schema, database version, storage reader/writer, or protocol shape.
ChatStreamSegmentand message materialization are unchanged from the base. No migration or cache reset is needed.Related prior commentary work: #140834 and #144498. This revision prevents the stream split rather than expanding their cleanup logic.
Worked on by
View the OpenClaw team session