Repository navigation
fix(reply): preserve explicit routing through block coalescing - #129271
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 8:25 AM ET / 12:25 UTC. ClawSweeper reviewWhat this changesThis PR retains the original reply payload while coalescing streamed text, so explicit reply targeting and internal delivery metadata survive text and text-plus-media flushes. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review: the focused coalescer repair removes the current-main reconstruction that drops explicit routing, and no blocking patch defect was found. The PR is maintainer-authored/protected; the remaining work is exact-head validation and the already-running Telegram proof. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherStreaming reply blocks enter the block-reply pipeline, which coalesces them before passing one payload to channel delivery. Routing fields on that payload determine which incoming message Telegram and other channel owners reply to. flowchart LR
A[Streaming reply blocks] --> B[Block reply pipeline]
B --> C[Block coalescer]
C --> D[Combined reply payload]
D --> E[Channel delivery owner]
E --> F[Requested reply target]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -33, Tests +55. Total +22 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA Telegram Desktop transcript can directly show that a coalesced reply remains attached to the requested message rather than an implicit quoted message. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical buffered ReplyPayload and alter only its coalesced text, preserving media-specific fields when a media payload joins the buffer. Do we have a high-confidence way to reproduce the issue? Yes, at high confidence from source: coalescing a payload with replyToCurrent or replyToTag reaches the current field list, which omits both fields before delivery reads replyToCurrent. The review did not execute the reproduction because this checkout is read-only. Is this the best way to solve the issue? Yes. Preserving the original buffered payload and replacing only text fixes the owner-boundary loss without adding a Telegram-specific exception or another parallel routing path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 081ce11324fb. 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 (1 earlier review cycle)
|
Mantis Telegram proof — PASSSummary: Baseline lost explicit block-reply routing and replied to the older quoted message; candidate retained the routing intent and replied to the current Telegram request.
Motion-trimmed clips: |
|
Merged via squash.
|
…law#129271) * fix(reply): preserve explicit routing through block coalescing * fix(reply): narrow buffered payload before reading visibility


Summary
Root cause
The block coalescer decomposed a
ReplyPayloadinto a small hand-maintained list of properties, then rebuilt a new payload. Explicit routing flags were absent from that list, so downstream Telegram delivery could mistake intentional replies for implicit replies and route them to the wrong message. The media merge also lost the buffered routing intent when a later media payload omitted it.Validation
42instead of the requested message100; both text and media now retain target100.OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/auto-reply/reply/block-reply-pipeline.test.ts src/auto-reply/reply/block-reply-pipeline.multi-message.test.ts— 33 tests passed.git diff --check, type-aware lint, and independent Codex autoreview passed.