fix: stop partial replies for whatsapp/telegram surfaces

This commit is contained in:
Peter Steinberger
2025-12-09 01:40:51 +01:00
parent e44ed2681f
commit 5bfecc6152
6 changed files with 107 additions and 88 deletions

View File

@@ -823,31 +823,6 @@ export async function monitorWebProvider(
},
{
onReplyStart: latest.sendComposing,
onPartialReply: async (partial) => {
try {
await deliverWebReply({
replyResult: partial,
msg: latest,
maxMediaBytes,
replyLogger,
runtime,
connectionId,
});
if (partial.text) {
recentlySent.add(partial.text);
if (recentlySent.size > MAX_RECENT_MESSAGES) {
const firstKey = recentlySent.values().next().value;
if (firstKey) recentlySent.delete(firstKey);
}
}
} catch (err) {
console.error(
danger(
`Failed sending partial web auto-reply to ${latest.from ?? conversationId}: ${String(err)}`,
),
);
}
},
},
);