From 1559e28d6b46bc4058f0f9cfb3a57a0b50981f54 Mon Sep 17 00:00:00 2001 From: jindongfu Date: Sat, 25 Apr 2026 17:49:15 +0800 Subject: [PATCH] fix(get-reply): include inboundUserContext in empty-body guard (#71489) The empty-body guard only checked baseBodyFinal (current message body) and softResetTail, ignoring inboundUserContext which includes InboundHistory from group chat context. This caused the bot to reject bare @mentions in Feishu group chats where prior messages provided the conversation context via InboundHistory. Now hasUserBody also checks whether inboundUserContext has content, matching the behavior before the 2026.4.12 refactor. --- src/auto-reply/reply/get-reply-run.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auto-reply/reply/get-reply-run.ts b/src/auto-reply/reply/get-reply-run.ts index 01dab509e0b..7583126238d 100644 --- a/src/auto-reply/reply/get-reply-run.ts +++ b/src/auto-reply/reply/get-reply-run.ts @@ -455,7 +455,10 @@ export async function runPreparedReply( .filter(Boolean) .join("\n\n") : [inboundUserContext, baseBodyFinal].filter(Boolean).join("\n\n"); - const hasUserBody = baseBodyFinal.trim().length > 0 || softResetTail.length > 0; + const hasUserBody = + baseBodyFinal.trim().length > 0 || + softResetTail.length > 0 || + (inboundUserContext != null && inboundUserContext.trim().length > 0); const hasMediaAttachment = hasInboundMedia(sessionCtx) || (opts?.images?.length ?? 0) > 0; if (!hasUserBody && !hasMediaAttachment) { // Skip onReplyStart when typing is suppressed (e.g. sendPolicy deny) —