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 <noreply@anthropic.com>
This commit is contained in:
parent
a2d06e75b0
commit
0761652701
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user