Repository navigation
fix(reply): prevent deduplicated follow-ups from losing threaded replies - #129123
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:02 AM ET / 08:02 UTC. ClawSweeper reviewWhat this changesThe PR prevents deduplicated queued follow-up payloads from consuming a one-time threaded-reply slot while retaining channel-specific route-aware deduplication. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main retains the pre-deduplication threading order; this active maintainer PR moves route preview and single-use reply-slot commitment into the canonical threading owner, with no blocking defect found. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherQueued follow-up responses are normalized, assigned a reply route, deduplicated against message-tool sends, and then delivered to the originating channel. The changed boundary decides which visible payload earns a single threaded-reply slot. flowchart LR
A[Queued follow-up payloads] --> B[Reply route preview]
B --> C[Route-aware deduplication]
C --> D{Visible payload remains}
D -->|No| E[Discard without consuming slot]
D -->|Yes| F[Commit reply threading]
F --> G[Channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +100. Total +106 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single canonical threading filter with its side-effect-free preview, then deduplicate and commit only surviving payloads; no net-neutral refactor can remove that lifecycle distinction without moving state ownership downstream. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main commits the stateful single-use threading filter before deduplication, while the new tests exercise the resulting discarded-first-payload case. Is this the best way to solve the issue? Yes. Previewing the existing channel-aware threading owner before deduplication preserves actual transport routing while delaying its only state mutation until a visible payload remains. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7ba58abd93d6. 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
|
|
Merged via squash.
|
…ies (openclaw#129123) * fix(reply): dedupe follow-ups before consuming reply threads * refactor(reply): remove obsolete threading re-export
What Problem This Solves
Fixes an issue where users would receive no reply, lose the expected threaded reply, or receive a duplicate Slack reply when a messaging tool had already delivered media or text during a queued follow-up.
Why This Change Was Made
Follow-up delivery applied stateful first/batched reply threading before message-tool deduplication. Duplicate payloads consequently consumed the single-use reply slot, deduplicated media survived as an empty but explicitly deliverable reply, and empty replies blocked recovery of a substantive assistant final. Naively reversing the order also changed Slack's actual thread destination, so the canonical threading owner now supports a side-effect-free route preview: deduplication sees the eventual transport destination, while the reply slot is committed only after a visible payload survives.
Production delta: +24/-18 (net +6), justified by the new owner-level preview/commit boundary that preserves actual channel routing while preventing discarded payloads from consuming state; the obsolete threading barrel export was removed. Tests: +102/-2.
User Impact
Previously sent media never suppresses a real assistant answer, duplicate media or text never steals the first threaded reply, substantive message-tool-only answers recover normally, and Slack replies are deduplicated against their actual transport thread.
Evidence
deliverdecision instead ofretry-source-delivery.node scripts/run-vitest.mjs src/auto-reply/reply/followup-delivery.test.ts src/auto-reply/reply/followup-delivery.channel.test.ts src/auto-reply/reply/reply-payloads.test.ts src/auto-reply/reply/reply-threading.test.ts src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/reply-plumbing.test.ts: 212 passed, 1 existing skipped.