Repository navigation
fix: preserve paragraph boundaries across streamed replies - #119549
qingminglong wants to merge 9 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 13, 2026, 3:39 PM ET / 19:39 UTC. ClawSweeper reviewWhat this changesThe PR updates streamed-reply chunking, rendering, coalescing, and BTW delivery so paragraph separators survive bounded reply deliveries without duplicate blank lines. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep open: the supplied branch evidence addresses the prior separator-tail findings, but its proof is synthetic/local rather than a real client or mock-gateway boundary run, and the checkout could not be inspected because every read command failed in the sandbox. Priority: P1 Review scores
Verification
How this fits togetherAssistant stream text is split into bounded blocks, passed through rendering and reply coalescing, then delivered to channel handlers. The change preserves Markdown paragraph boundaries through those stages. flowchart LR
A[Assistant text stream] --> B[Block chunker]
B --> C[Stream renderer]
C --> D[Reply coalescer]
D --> E[Reply pipeline]
E --> F[Channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +124, Tests +429. Total +553 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Before merge, attach a redacted exact-head mock-gateway or real-client trace showing bounded streamed output and BTW delivery preserve one paragraph boundary, then consolidate any duplicate separator policy into the chunker/coalescer owner boundary. Do we have a high-confidence way to reproduce the issue? No high-confidence independent reproduction is available: the supplied context provides focused synthetic runtime traces, but sandbox failure prevented validating the exact source or running a current-head delivery path. Is this the best way to solve the issue? Unclear: the patch targets the correct chunk-to-delivery boundary and prior findings, but an exact-head gateway/client trace is needed to show this is the best end-to-end repair. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against f2f3ba2eaff3. LabelsLabel 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 (10 earlier review cycles; latest 8 shown)
|
2cfbf9d to
b5b5d5c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
061df13 to
15d7b60
Compare
15d7b60 to
c340501
Compare
db0aafd to
f395ca2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b965d7f to
64b0dd2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
831d384 to
a56e0cd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a56e0cd to
d20b0e1
Compare
Closes #42106
What Problem This Solves
Fixes an issue where users receiving block-streamed replies could see paragraph boundaries disappear when a reply crossed multiple streamed deliveries.
Why This Change Was Made
Paragraph separators are preserved on the delivery that ends a paragraph, while coalescing avoids adding a second separator when that boundary is already present. Equal-cap separator tails remain sendable, and BTW delivery admits recognized paragraph separators without forwarding ordinary whitespace-only payloads.
User Impact
Streamed Markdown keeps its paragraph structure when the client reconstructs successive reply deliveries without exceeding the configured outbound chunk limit, including BTW side-question deliveries.
Evidence
a56e0cd477deb1afea0c56dd8151708c3b5ad1d5.EmbeddedBlockChunkerpluscreateBlockReplyPipelinewithmaxChars=10processedabcdefghij\n\ninto bounded chunks["abcdefghij", "\\n\\n"]and delivered the same two payloads.{"chunks":["abcdefghij","\\n\\n"],"delivered":["abcdefghij","\\n\\n"],"lengths":[10,4]}.runBtwSideQuestionwithmaxChars=10delivered["abcdefghij", "\\n\\n", "Next", "paragraph."], preserving the separator between forced blocks while respecting the cap.reply-utils.test.ts109/109,block-reply-pipeline.test.ts25/25, the focused BTW separator test 1/1, chunker/subscriber boundary tests 27/27; targetedoxfmt --check,oxlint, andgit diff --checkpassed.