Repository navigation
refactor(agents): share preferred block chunk boundaries - #148391
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 maintainer review before merge. Reviewed September 15, 2026, 3:59 AM ET / 07:59 UTC (Revision 2). ClawSweeper reviewWhat this changesShares streamed-reply boundary selection between normal draining and forced tails, with tests preserving chunk order and original-text accounting. Merge readiness✅ Ready for maintainer review The cleanup remains useful on current main, and this review found no actionable defect. The member-authored PR preserves existing behavior and has passing hosted validation. Priority: P3 Review scores
Verification
How this fits togetherThe block chunker turns incoming assistant text into Markdown-safe reply blocks. Streaming callers send those blocks onward while tracking how much original text has been consumed. flowchart TD
A[Assistant text] --> B[Pending reply buffer]
B --> C{Normal drain or forced tail}
C --> D[Shared preferred boundary selection]
D --> E[Fence-safe and length fallbacks]
E --> F[Reply blocks and source accounting]
F --> G[Streaming delivery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -25, Tests +64. Total +39 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one private owner for boundary precedence while preserving the existing drain directions, fence handling, and source-accounting contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated implementation rather than a reported runtime failure; source inspection confirms the duplication remains on main. Is this the best way to solve the issue? Yes. Sharing the existing private selector removes duplicate precedence rules while preserving caller-specific direction and fallback behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e83fa1461db6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '0cd944c01416c4f9c1f6dc9d1dea9670c5b99cab': improve: speed up session search for restricted operators (#148826) fix(update): avoid retry guidance for historical abandoned runs (#146982) fix(android): reduce queued-message send overhead (#148899) refactor(slack): count table cells only for native output (#148872) fix: correct update status and apply saved model keys (#148830) refactor(nostr): share doctor state migration flow (#148647) refactor(gateway): centralize device token denial responses (#148644) test: make kitchen sink assertions runtime portable (#148891) refactor(agents): share preferred block chunk boundaries (#148391) fix(ui): use the selected timezone for Usage date shortcuts (#148277) test: probe active Node in release preflight (#148892) fix(test): restore services typecheck shard headroom (#148889)
What Problem This Solves
This maintainer-requested refactor is part of the approved duplication and complexity reduction deliverable. The block chunker repeats paragraph, newline and sentence preference selection in its capped-window and forced-tail paths. Keeping those branches synchronized requires editing two copies of the same precedence rules.
User Impact
No intended boundary or source-text change. Forced tails still choose the first paragraph or newline boundary, capped windows choose the last, and sentence selection remains last in both paths. Newline preference still avoids sentence fallback.
Why This Change Was Made
Both paths call one private preferred-boundary selector with their existing direction, minimum length, absolute offset and open-fence context. Capped whitespace and hard-limit fallbacks, UTF-16 progress, fence reopening, source cursors and emission order remain with their existing owners.
Production: -25 lines. Tests: +64 lines. This mechanical refactor needs no changelog entry.
Evidence
932e1f79d664901359919e3f23df042451d5e41c; actual tested merge4a14a243e65db54e37a5d23102f43e75b464d891contains the reviewed two-file change.oxfmt --check: all 38,224 matched files used the correct format. These passing executions were carried forward into attempt 2.No live-channel behavior, performance improvement or bundle reduction is claimed.