From 0761652701e3cb034e0674e747db0560db746e70 Mon Sep 17 00:00:00 2001 From: kiranjd Date: Tue, 27 Jan 2026 21:43:49 +0530 Subject: [PATCH] fix(telegram): handle empty reply array in notifyEmptyResponse Previous fix only checked skippedEmpty > 0, but when model returns content: [] no payloads are created at all. Now also checks replies.length === 0 to catch this case. Co-Authored-By: Claude Opus 4.5 --- src/telegram/bot/delivery.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/telegram/bot/delivery.ts b/src/telegram/bot/delivery.ts index f0fd51c8c..648ddeeab 100644 --- a/src/telegram/bot/delivery.ts +++ b/src/telegram/bot/delivery.ts @@ -274,7 +274,8 @@ export async function deliverReplies(params: { } // If all replies were empty and notifyEmptyResponse is enabled, send a fallback message - if (!hasReplied && skippedEmpty > 0 && params.notifyEmptyResponse) { + // Check both: (1) replies with no content (skippedEmpty), (2) no replies at all (empty array) + if (!hasReplied && (skippedEmpty > 0 || replies.length === 0) && params.notifyEmptyResponse) { const fallbackText = "No response generated. Please try again."; await sendTelegramText(bot, chatId, fallbackText, runtime, { messageThreadId,