Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 26, 2026, 5:00 PM ET / 21:00 UTC. Summary PR surface: Source +64, Tests +101. Total +165 across 8 files. Reproducibility: yes. source-level. At PR head, Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one consolidated shared chunker/subscriber/coalescer fix that preserves paragraph boundaries for both in-budget and Do we have a high-confidence way to reproduce the issue? Yes, source-level. At PR head, Is this the best way to solve the issue? No. The shared chunker/subscriber/coalescer layer is the right place, but the text-only implementation is partial until overflow paragraph boundaries are represented without exceeding maxChars or corrupting coalesced seams. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9636bea901d0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +64, Tests +101. Total +165 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
…eliveries Carry the paragraph boundary through the delivered block-reply path and keep emitted chunks within maxChars (openclaw#42106): - chunker: attach the canonical `\n\n` separator to paragraph-split chunks and reserve its length in the fit check; re-attach in #emitBreakResult only when the result stays within maxChars. - emitBlockChunk: preserve a single trailing `\n\n` on non-final deliveries (the separator the chunker attached) so successive separate deliveries reconstruct the blank line; keep assistantTexts separator-free via visibleChunk. - coalescer: joinBufferedText strips a trailing whitespace run from the left before re-joining (whitespace joiner) so separator-carrying chunks in one flush do not produce `\n\n\n\n`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@clawsweeper re-review Revision addresses the durable verdict's P1/P2 findings and the proof gap:
Full scoped test suite passes (chunker 10, subscribe 7+33+145, coalescer 76), |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Note on the two red CI checks (not caused by this diff):
The maintainer-approval-independent checks that ran on the prior head (Real behavior proof, actionlint, label, auto-response, check-prod-types, check-guards, check-lint) are passing or re-running; heavy shards are queued on |
|
@clawsweeper re-review Followed up on the durable verdict's [P1] overflow-boundary finding ( The P1 range. It is not just the exact
No text-only chunk can close this. I verified all four exits against the current diff:
(Sibling #94216 reached the same three-exit conclusion; the coalesced word-split in exit 3 is the additional reason a pure text fix can't satisfy both the separate-delivery and coalesced invariants at once.) Why the in-budget fast-path works but the overflow case can't. The fast path is correct in both regimes because all three conditions hold simultaneously at the seam: seam == paragraph boundary, separator carried in-band on the left chunk, and in budget. The coalescer's Recommendation. The clean fix is your option 3 territory — carry explicit boundary metadata on the block-reply payload (a Risk in the meantime. With production defaults ( On consolidation with #94216: both candidates converge on the same validated in-band + smart-join shape and both hit the same text-only wall at the overflow boundary. I'm aligned with eldar702's assessment; which implementation lands is the maintainers' call. Happy to implement boundary metadata if that's the preferred direction. Current state: scoped suites green (chunker 10, subscribe 7+33+145, coalescer 76), |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
What problem does this PR solve?
When block streaming splits a reply across multiple streamed deliveries, the paragraph (
\n\n) separator between two paragraphs is consumed at the chunk boundary and never reaches a client that rebuilds the visible reply by concatenating successive deliveries. The Markdown collapses:# Title\n\nFirst paragraph.\n\nSecond paragraph.reconstructs as# TitleFirst paragraph.Second paragraph.Why does this matter now?
It is deterministic user-visible Markdown corruption: heading-into-paragraph and paragraph-into-paragraph boundaries vanish whenever a paragraph-separated reply is flushed across more than one delivery. There is no open, merged fix for the shared chunker/coalescer boundary (prior attempts #73981 / #42824 were closed unmerged — the former stale/dirty, the latter a channel-specific workaround).
What is the intended outcome?
A reply split into multiple block-streamed deliveries stays Markdown-equivalent when the deliveries are concatenated, and two separator-carrying chunks coalesced into one flush do not emit a doubled separator.
What is intentionally out of scope?
What does success look like?
chunks.join("") === originalInputfor a paragraph-separated reply split into multiple deliveries, plus no\n\n\n\ndoubling when such chunks share a coalesced flush.What should reviewers focus on?
The
paragraphBreak.index + paragraphBreak.lengthslice in the chunker (separator now stays on the emitted chunk) and thejoinBufferedTexthelper in the coalescer (suppresses the joiner when buffered text already ends with it).Linked context
Which issue does this close?
Closes #42106
Which issues, PRs, or discussions are related?
Related #73981 (closed unmerged, stale/dirty branch), #42824 (closed unmerged, channel-specific workaround).
Was this requested by a maintainer or owner?
No. ClawSweeper's durable review on the issue confirmed the shared chunker/coalescer boundary is the right layer and that no implemented fix exists on main.
Real behavior proof (required for external PRs)
\n\nparagraph case only (newline/sentence preference paths unchanged).Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs src/agents/embedded-agent-block-chunker.test.ts(9 passed)node scripts/run-vitest.mjs src/auto-reply/reply/reply-utils.test.ts(76 passed)node scripts/run-vitest.mjs src/auto-reply/reply/block-reply-pipeline.test.ts src/auto-reply/reply/block-streaming.test.ts(7 + 24 passed)pnpm tsgo(exit 0),pnpm lint(exit 0),pnpm build(exit 0)pnpm format:checkon changed files (clean — the 83 files it reports are pre-existing main drift, none are touched by this PR)What regression coverage was added or updated?
src/agents/embedded-agent-block-chunker.test.ts: new test "preserves paragraph separators across streamed deliveries ([Bug]: Block streaming can drop paragraph separators across streamed updates #42106)" assertingchunks.join("") === inputfor a multi-delivery split; updated three existing assertions to the corrected trailing-separator shape.src/auto-reply/reply/reply-utils.test.ts: new tests "does not double the separator when buffered text already ends with it ([Bug]: Block streaming can drop paragraph separators across streamed updates #42106)" and "still joins separator-free chunks with the configured joiner".What failed before this fix, if known?
Before the fix the new chunker regression test fails (
chunks.join("")drops all\n\n), and the coalescer no-double-separator test would produce"# Title\n\n\n\nFirst paragraph.\n\n\n\n"without the smart-join helper.If no test was added, why not?
N/A — tests added.
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes — block-streamed replies now preserve paragraph boundaries across deliveries (the intended fix).
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
Two separator-carrying chunks coalesced into one flush producing a doubled
\n\n(which would render as an extra blank line).How is that risk mitigated?
The
joinBufferedTexthelper suppresses the joiner when buffered text already ends with it; covered by the new coalescer test and the existing 24 block-streaming + 7 pipeline tests still pass. Non-paragraph (size/sentence) splits carry no trailing separator and are unaffected — still joined by the configured joiner, also explicitly tested.Current review state
What is the next action?
Await maintainer review.
What is still waiting on author, maintainer, CI, or external proof?
CI on the pushed branch; maintainer review of the separator-preservation + smart-join approach.
Which bot or reviewer comments were addressed?
None yet (fresh PR).