Repository navigation
fix(outbound): prevent empty chunkers from silently dropping replies - #128288
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 23, 2026, 3:36 PM ET / 19:36 UTC. ClawSweeper reviewWhat this changesThe PR makes the core outbound planner send one nonempty text unit when its channel chunker returns no chunks, with regression coverage for default, length, and newline modes. Merge readinessThe core planner repair is sound, but the same empty-chunker drop remains in public SDK delivery helpers used by custom channel adapters; merge after that shared invariant is applied there too. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOutbound delivery turns normalized agent reply text into channel send operations. Most channels use the core planner, while custom adapter paths call Plugin SDK delivery helpers directly before sending to their transports. flowchart LR
A[Agent reply text] --> B[Delivery routing]
B --> C[Core message planner]
B --> D[Custom channel adapter]
C --> E[Channel chunker]
D --> F[Plugin SDK chunking helper]
E --> G[Platform sends]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +33. Total +31 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use the existing SDK fallback at both raw SDK chunker call sites and add behavior-level regressions so core and custom-adapter delivery share the no-silent-drop invariant. Do we have a high-confidence way to reproduce the issue? Yes, source reproduces it: a nonempty text payload plus a chunker returning [] reaches the SDK raw chunk loops, causing zero sends and an empty or undefined result. Is this the best way to solve the issue? No; centralizing the core planner fallback is the right partial repair, but the existing SDK delivery owners still bypass it and already expose the same fallback abstraction. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b3b33d24195d. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
History |
|
Merged via squash.
|
What Problem This Solves
Prevents normal outbound replies from disappearing completely when a channel-specific text chunker unexpectedly returns no parts for a nonempty message.
Why This Change Was Made
The newline chunking branch already preserved nonempty text after an empty adapter chunk result, but default and length-based chunking silently produced zero platform sends. Move that existing invariant into the single shared chunk-planning owner and delete the duplicate newline-only recovery branch.
User Impact
Visible replies are delivered across every chunking mode instead of being silently lost or misreported as lacking a platform receipt. Existing reply-to consumption, delivery-part numbering, and formatting behavior are preserved.
Evidence
node scripts/run-vitest.mjs src/infra/outbound/message-plan.test.ts src/infra/outbound/reply-policy.test.ts— 11 tests passed.git diff --checkpassed.ClawSweeper Rank-Up Review
mainadvanced.