Repository navigation
fix(ui): avoid duplicate CLI replies during transcript persistence - #190655
Conversation
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]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@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. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +35, Other +2. Total +37 across 3 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 3:33 PM ET / 20:33 UTC. |
|
Merged via squash auto-merge.
|
…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]>
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
d5320176f888add7314f2bedc84851d10991f96f, the new matching-key regression fails: the durable row is present butchatStreamstill containsCLI answer(1 failed, 8 passed; 3.46s Vitest, 4.64s runner).session-message-apply.test.tsandstream-reconciliation.test.tsfiles pass: 25 tests, 2.17s Vitest / 3.13s runner. The fixture retains the producer's actual__openclaw.runIdmetadata while omitting the outer terminal run ID.git diff --checkpass. Exact-head PR CI passed all 37 executed jobs in 7m 16s; the published CI, dependency, and security gates passed.scoped-clean, no actionable findings. The subsequent commit contains the reviewed source unchanged. Hosted ClawSweeper review also found no actionable findings.