fix(telegram): gate media dedup on visible delivery

This commit is contained in:
Ayaan Zaidi
2026-05-10 08:07:16 +05:30
parent 22e564da4b
commit 6bf9185d27
2 changed files with 0 additions and 10 deletions

View File

@@ -1,9 +1,3 @@
/**
* Deduplicate media URLs in a final-reply payload against media already
* delivered via block replies. Returns the deduplicated payload, or
* undefined if the payload should be skipped entirely (all media already
* sent and no text remains).
*/
export function deduplicateBlockSentMedia<
T extends { mediaUrl?: string; mediaUrls?: string[]; text?: string },
>(payload: T, sentBlockMediaUrls: ReadonlySet<string>): T | undefined {

View File

@@ -1166,10 +1166,6 @@ export const dispatchTelegramMessage = async ({
recordInboundSession: context.turn.recordInboundSession,
record: context.turn.record,
runDispatch: () => {
// Track media URLs delivered via block replies so final replies
// can skip duplicates. Without this, non-streaming Telegram
// delivers each MEDIA: attachment twice — once from the
// media-only block reply and once from the final reply.
const sentBlockMediaUrls = new Set<string>();
return telegramDeps.dispatchReplyWithBufferedBlockDispatcher({