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.
This commit is contained in:
jindongfu
2026-04-25 17:49:15 +08:00
committed by Peter Steinberger
parent 1549ded4ac
commit 1559e28d6b

View File

@@ -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) —