#14216: fix(messaging): check both pipeline and direct keys for reply deduping
agents
stale
Cluster:
Telegram Message Handling Fixes
## Summary
- Ensures that payloads are correctly deduped by checking both the block streaming pipeline AND the direct sent block keys.
- This prevents double-sending payloads when the pipeline is created late or intermittent.
Co-authored-by: F1xTrack <1993961048@qq.com>
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
The change updates reply payload deduplication to drop any final payloads that have already been sent either via the block streaming pipeline (`blockReplyPipeline.hasSentPayload`) or directly during tool flush (`directlySentBlockKeys`). This addresses cases where the pipeline may be created late or intermittently, so relying on only one mechanism could double-send replies.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge; it makes a focused deduplication change with low behavioral surface area.
- The only code change in the head commit is a localized filter predicate in `buildReplyPayloads`, and the logic is straightforward (exclude if sent via either pathway). Remaining risk is whether `hasSentPayload` and `createBlockReplyPayloadKey` are consistent for all payload shapes, but the change is additive to existing dedupe and should reduce duplicates rather than introduce them.
- src/auto-reply/reply/agent-runner-payloads.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#5080: fix(reply): fix duplicate block replies by unblocking coalesced pay...
by yassine20011 · 2026-01-31
82.9%
#8205: fix: flush followup messages incrementally
by hanxiao · 2026-02-03
79.2%
#12180: fix: merge multi-block assistant texts into single reply
by 1960697431 · 2026-02-08
76.0%
#20235: fix(reply): prevent duplicate final payloads in block pipeline
by PeterShanxin · 2026-02-18
75.7%
#22675: feishu: move message dedup to just before dispatch
by zijiegeng · 2026-02-21
73.6%
#17953: fix(telegram): prevent silent message loss and duplicate messages i...
by zuyan9 · 2026-02-16
73.3%
#7719: fix(slack): thread replies with @mentions dropped in requireMention...
by SocialNerd42069 · 2026-02-03
71.8%
#18077: fix: deduplicate TTS audio delivered via tool results
by stakeswky · 2026-02-16
70.3%
#17316: fix: ack reaction not removed when block streaming is enabled (Tele...
by czmathew · 2026-02-15
69.9%
#21484: fix(feishu): scope message deduplication by accountId to support mu...
by guanyu-zhang · 2026-02-20
69.7%