Repository navigation
fix(chat): keep code controls when streaming fences close - #154430
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: blocked before merge. Reviewed September 21, 2026, 4:35 AM ET / 08:35 UTC (Revision 5). ClawSweeper reviewWhat this changesPreserves code-block expansion and wrapping when a streamed fence closes, with browser regressions and updated chat documentation. Merge readiness⛔ Blocked before merge - 2 items remain The focused fix remains necessary on current main, and no introduced correctness or security defect was found. The current screenshot attachments could not be inspected, leaving the repository’s visual landing gate unresolved. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI converts streamed assistant Markdown into completed fragments and an active tail. This change keeps the tail’s existing DOM and controls when it becomes a completed fragment. flowchart LR
A[Assistant text updates] --> B[Sanitize and split Markdown]
B --> C[Completed fragments]
B --> D[Active tail]
D --> E[Fence closes]
E --> C
C --> F[Retained code controls]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +27, Tests +330, Docs +1. Total +358 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep promotion inside the existing Markdown renderer while preserving canonical resets and the lightweight completed-history path. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the trigger: expand and wrap an open streamed fence, then append its closing delimiter. Current main transfers that content into a different rendered part; the new E2E case exercises this sequence, but was not run during this review. Is this the best way to solve the issue? Yes. Reusing the existing fragment and incremental renderer repairs the promotion boundary without introducing a second state owner or changing saved-history identity. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7ff455860b90. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Retain ordinary Markdown and assistant-body occurrence identity through append-only promotion, finalization, and definitive saved-history adoption. Keep ambiguous replacements and semantic resets intentional; preserve static completed-history rendering.
a8be8f5 to
5ae0d05
Compare
|
Merged via squash auto-merge.
|
…54430) * fix(chat): keep reader state when streamed replies finish Retain ordinary Markdown and assistant-body occurrence identity through append-only promotion, finalization, and definitive saved-history adoption. Keep ambiguous replacements and semantic resets intentional; preserve static completed-history rendering. * fix(chat): give stream projection types acyclic owners * fix(chat): preserve authoritative receipt handoff identity * fix(chat): narrow control retention to streaming Markdown
What Problem This Solves
Closing a streamed code fence moves its Markdown from the active tail into the stable prefix. That move recreated the DOM, dropping expansion/wrapping choices and reader enhancements even though the reply was still streaming.
User Impact
Code controls keep their state when a fence closes and later paragraphs arrive in the same live reply. Corrections, rendering-option changes, and reference reinterpretation still reset content when needed.
This does not preserve DOM across final/saved-history replacement. The broader continuity work has been removed and deferred. No deployment is included.
Why This Change Was Made
Keep the promoted fragment in the same ordered Lit part and retain its existing renderer. Already-completed history still uses the lightweight static path.
The final diff is four files: +27 net production lines, +330 test lines, and +1 docs line—a 97% reduction in production growth from the earlier version of this PR. No projection, gateway, run-lifecycle, or saved-message identity changes remain.
Evidence
Before: expansion and wrapping are lost.
After: all nine rows stay expanded and wrapped.