Skip to content

fix(ui): avoid duplicate CLI replies during transcript persistence - #190655

Merged
roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-180956
Nov 1, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-180956

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #180927

Supersedes #180956, thanks @A-Raphie.

What Problem This Solves

Fixes: Control UI shows a CLI assistant answer twice when its transcript row arrives while the run is still active.

User Impact

The saved CLI reply replaces its matching live reply immediately, without ending the active run or removing unrelated commentary.

Why This Change Was Made

The existing pane owner already admits producer-owned rows. Its live-tail retirement now also recognizes the exact persisted cli-assistant:<runId> key when the outer event omits its run ID. Producer admission and keyed commentary rules remain intact.

Production LOC is net zero (+3/-3); the comment is condensed alongside the condition. The 35 added regression-test lines cover matching and conflicting CLI keys through the pane event entry point, with a dedicated test-line allocation.

Evidence

  • On current main d5320176f888add7314f2bedc84851d10991f96f, the new matching-key regression fails: the durable row is present but chatStream still contains CLI answer (1 failed, 8 passed; 3.46s Vitest, 4.64s runner).
  • After the fix, the named session-message-apply.test.ts and stream-reconciliation.test.ts files pass: 25 tests, 2.17s Vitest / 3.13s runner. The fixture retains the producer's actual __openclaw.runId metadata while omitting the outer terminal run ID.
  • Touched-file type-aware lint, oxfmt, and git diff --check pass. Exact-head PR CI passed all 37 executed jobs in 7m 16s; the published CI, dependency, and security gates passed.
  • Local autoreview (Codex, P0–P2) reviewed the complete local candidate against the main SHA above: scoped-clean, no actionable findings. The subsequent commit contains the reviewed source unchanged. Hosted ClawSweeper review also found no actionable findings.
  • As explicitly scoped for this takeover, proof is unit-only; no browser, screenshot, live Gateway, build, or broad local suite was run. Contributor code was read through GitHub and never checked out or executed.

Retire the pane live reply when its admitted persisted CLI row carries the matching assistant send key, even before the terminal run event arrives. Preserve keyed commentary and mismatched identities.

Co-authored-by: A-Raphie <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 1, 2026 20:28
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Local autoreview is complete (P0–P2, no actionable findings). This replacement preserves producer admission and narrows retirement to the exact persisted CLI key; the regression carries the current producer run metadata. This takeover is explicitly scoped to unit/component proof without a browser.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 1, 2026 20:33
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR clears a matching live CLI reply when its saved transcript row arrives before the run finishes.

Example: Run current-run displays “CLI answer”, then saves cli-assistant:current-run without an outer event run ID.

  • Before: The saved answer and live answer remain visible together.
  • After: The saved answer replaces the live copy while current-run stays active.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with meaningful pane-event coverage and no actionable findings; supplied validation remains component-level.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied evidence exercises the production pane event owner in process and reports matching-key regression failure before the fix and success afterward.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A CLI assistant answer appears twice while its saved row and live stream coexist.
Reason: The maintainer-authored repair restores one visible answer through the existing owner and preserves the intentionally separate commentary lifecycle.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a current reconciliation defect with a focused change; no actionable correctness or security findings were identified.

Priority: P2
Reviewed head: 071da2bff8da82d56031eef3e77782fad05b0796

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No browser or isolated-Gateway CLI turn demonstrates the rendered replacement; the maintainer explicitly scoped this takeover to unit/component proof.
Agent review details

How this fits together

Gateway transcript events enter the Control UI pane reducer, which admits durable messages and reconciles their live display before rendering the conversation.

flowchart LR
  A[CLI runner] --> B[Transcript persistence]
  B --> C[Gateway session message]
  C --> D[Pane admission and projection]
  E[Live reply stream] --> D
  D --> F[Chat display]
Loading

Technical review

Best possible solution:

Use the existing pane owner to retire only the admitted CLI reply’s matching live tail while preserving commentary and active-run state.

Do we have a high-confidence way to reproduce the issue?

Current-main source admits a producer-tagged CLI row but retains its live tail when the outer run ID is absent; the supplied regression models that exact event order and reports red/green results.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it extends the existing retirement condition using the producer’s established CLI key, without adding another owner or weakening admission.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 02e6735d3db4.

Provenance checked

  • Live-tail retirement in session-message-apply.ts changes intended behavior with a stated reason (f20ce15: Replace terminal live replies immediately while keeping metadata-only continuations, keyed commentary, and active tools intact.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ad189b0 adds ui/src/pages/chat/session-message-apply.ts:145 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ad189b0a5343; files: ui/src/pages/chat/session-message-apply.ts)
  • Patrick Erichsen: Raw commit 5a9d902 adds ui/src/pages/chat/session-message-apply.ts:84 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5a9d9020fd37; files: ui/src/pages/chat/session-message-apply.ts)
  • Shakker: Raw commit faa1cfc adds ui/src/pages/chat/session-message-apply.ts:133 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: faa1cfc5983c; files: ui/src/pages/chat/session-message-apply.ts)

PR surface

Source 0, Tests +35, Other +2. Total +37 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 35 0 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 40 3 +37

Root-cause cluster

Relationship: same_root_cause
Canonical: #180927
Summary: This PR addresses the canonical single-row duplicate-display report and explicitly replaces the earlier contributor implementation.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Duplicate visible answers confuse a functioning chat workflow, without demonstrated message loss or a blocked first run.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Duplicate visible answers confuse a functioning chat workflow, without demonstrated message loss or a blocked first run.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 1, 2026, 3:33 PM ET / 20:33 UTC.

@roboclaw-bot
roboclaw-bot merged commit 0b34d53 into main Nov 1, 2026
151 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-180956 branch November 1, 2026 20:36
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…penclaw#190655)

Retire the pane live reply when its admitted persisted CLI row carries the matching assistant send key, even before the terminal run event arrives. Preserve keyed commentary and mismatched identities.

Co-authored-by: A-Raphie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebChat shows the CLI assistant reply twice when block streaming is off

1 participant