diff --git a/extensions/feishu/src/bot.ts b/extensions/feishu/src/bot.ts index a5fd255cfd6..6dcfa6eb02c 100644 --- a/extensions/feishu/src/bot.ts +++ b/extensions/feishu/src/bot.ts @@ -1160,6 +1160,7 @@ export async function handleFeishuMessage(params: { runtime: runtime as RuntimeEnv, chatId: ctx.chatId, replyToMessageId: ctx.messageId, + skipReplyToInMessages: !isGroup, replyInThread, rootId: ctx.rootId, mentionTargets: ctx.mentionTargets, diff --git a/extensions/feishu/src/reply-dispatcher.ts b/extensions/feishu/src/reply-dispatcher.ts index cbdca4b570e..cda4e6e506e 100644 --- a/extensions/feishu/src/reply-dispatcher.ts +++ b/extensions/feishu/src/reply-dispatcher.ts @@ -28,6 +28,8 @@ export type CreateFeishuReplyDispatcherParams = { runtime: RuntimeEnv; chatId: string; replyToMessageId?: string; + /** When true, preserve typing indicator on reply target but send messages without reply metadata */ + skipReplyToInMessages?: boolean; replyInThread?: boolean; rootId?: string; mentionTargets?: MentionTarget[]; @@ -41,11 +43,13 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP agentId, chatId, replyToMessageId, + skipReplyToInMessages, replyInThread, rootId, mentionTargets, accountId, } = params; + const sendReplyToMessageId = skipReplyToInMessages ? undefined : replyToMessageId; const account = resolveFeishuAccount({ cfg, accountId }); const prefixContext = createReplyPrefixContext({ cfg, agentId }); @@ -189,7 +193,7 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP cfg, to: chatId, mediaUrl, - replyToMessageId, + replyToMessageId: sendReplyToMessageId, replyInThread, accountId, }); @@ -209,7 +213,7 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP cfg, to: chatId, text: chunk, - replyToMessageId, + replyToMessageId: sendReplyToMessageId, replyInThread, mentions: first ? mentionTargets : undefined, accountId, @@ -227,7 +231,7 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP cfg, to: chatId, text: chunk, - replyToMessageId, + replyToMessageId: sendReplyToMessageId, replyInThread, mentions: first ? mentionTargets : undefined, accountId, @@ -243,7 +247,7 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP cfg, to: chatId, mediaUrl, - replyToMessageId, + replyToMessageId: sendReplyToMessageId, replyInThread, accountId, });