Skip to content

Commit cb26abf

Browse files
committed
fix(telegram): use body-only dedup key for conversation context
The dedup key was `timestamp_ms:body` which fails when the same assistant reply appears in both the session transcript and the Telegram message cache with slightly different timestamps. Using body-only dedup prevents duplicate entries in the conversation context passed to the model.
1 parent f535b2a commit cb26abf

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

extensions/telegram/src/bot-handlers.runtime.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,7 @@ function resolvePromptContextTextDedupeKey(
190190
if (typeof message.body !== "string" || !message.body.trim()) {
191191
return undefined;
192192
}
193-
if (typeof message.timestamp_ms !== "number" || !Number.isFinite(message.timestamp_ms)) {
194-
return undefined;
195-
}
196-
return `${message.timestamp_ms}:${message.body.trim()}`;
193+
return message.body.trim();
197194
}
198195

199196
export const registerTelegramHandlers = ({

0 commit comments

Comments
 (0)