Repository navigation
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 real behavior proof before merge. What this changesThis PR lets a persisted CLI assistant row replace its matching live reply without an explicit envelope run ID. Example: Run cli-run-1 displays “Partial answer” when an assistant row with api=cli and idempotencyKey=cli-assistant:cli-run-1 arrives without an envelope or metadata run ID.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: the earlier stream-owner finding is resolved, but the CLI exception changes an intentional reconciliation contract and needs an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway chat deltas populate the live reply while persisted session.message events enter the pane’s transcript reducer, which reconciles the copies shown in the conversation. flowchart TD
A[CLI backend] --> B[Gateway chat deltas]
B --> C[Live reply]
A --> D[Transcript persistence]
D --> E[Session message event]
E --> F[Pane reconciliation]
C --> G[Visible conversation]
F --> G
Technical reviewBest possible solution: Keep reconciliation in the existing pane owner and repair the demonstrated producer or terminal-identity gap unless its owner approves a CLI-specific retirement contract. Do we have a high-confidence way to reproduce the issue? The synthetic pane event demonstrates the changed transition, but the current-main producer path supplies run metadata and no correlated product reproduction establishes the input responsible for the reported duplicate. Is this the best way to solve the issue? The revision uses the correct existing owner and adds no parallel machinery, but its inferred-identity exception should follow an owner decision about the intentional terminal boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 22338ef3220a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +15, Tests +73. Total +88 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label 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 HistoryReview history (2 earlier review cycles)
Reviewed October 22, 2026, 9:24 PM ET / October 23, 2026, 01:24 UTC (Revision 3). |
A CLI-backed webchat turn showed its answer twice with block streaming off: the live stream kept the partial text while the durable row was admitted beside it, because producer ownership requires an explicit envelope run id and the mid-run transcript publish can omit it. CLI assistant rows carry the run id in their server-stamped idempotency key (cli-assistant:<runId>), so accept that canonical run id as producer ownership and let the existing persistence path replace the live stream. Rows without CLI provenance keep the terminal-stream behavior.
80dc20d to
9caa2aa
Compare
|
Restructured per the review (head 9caa2aa): the keyed-segment fallback is removed — the review was right that CLI assistant deltas own The actual gap: the pane's existing stream-clear requires an explicit envelope run id, and the mid-run transcript publish can omit it. CLI assistant rows are self-proving — the Gateway stamps the run id into the persisted idempotency key ( Red/green: reverting the fix fails exactly the no-envelope-run-id regression; 10/10 in the file, 57/57 across the adjacent suites. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
check-lint fix pushed (the new assertion read a dangling-underscore member; it now spells the expected metadata literally). CI should go green on this head. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Friendly nudge: re-review was queued on this head (e232ab1) several days ago and no verdict has landed since. CI gate is fully green on the current head. @clawsweeper re-review |
|
Thanks @A-Raphie for identifying the CLI persistence/live-reply gap. Landed the focused replacement in #190655, preserving your co-author credit. The pane-event regression fails on main before the fix and passes afterward; exact-head CI is green. Closing this PR as superseded by the merged replacement. |
What Problem This Solves
Fixes #180927. In a Control UI webchat session on a CLI backend with block streaming off, the assistant reply appeared twice: the live stream bubble kept the partial text while the durable row, persisted mid-run, was admitted beside it. The reporter measured the corresponding gateway failure 360 times in one day.
The pane already clears the live stream when a persisted row owns the active run — but that ownership check requires an explicit envelope run id (
event.runId/ row metadata), and the mid-run transcript publish can omit it. CLI assistant rows are self-proving: the Gateway stamps the run id into the persisted idempotency key (cli-assistant:<runId>), which the projection layer already canonicalizes into the row's run id.What Changed
ui/src/pages/chat/session-message-apply.tsonly:role: assistant,api: "cli") whose canonical idempotency-key run id is present now qualifies as producer-owned for the matching active run, even when the envelope omits the run id.The first revision of this PR keyed a different stream owner (
chatStreamSegments) that the CLI assistant flow does not write; that path is gone. No other surface changes: rows without CLI provenance keep the terminal-stream behavior, and no delivery path gains or loses a send.Evidence
Red/green regression (
session-message-apply.test.ts, real pane event path: livechatStreamfilled, then the persistedsession.messagerow):Adjacent suites after the change: