mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 13:00:22 +00:00
feat(feishu): skip reply-to in DM conversations (#13211)
In DM (p2p) chats, use message.create instead of message.reply so that bot responses don't show a 'Reply to' quote. Group chats retain the reply-to behavior for context clarity. The typing indicator (emoji reaction on the user's message) is preserved in DMs — only the reply reference in sent messages is removed. Changes: - Add skipReplyToInMessages param to createFeishuReplyDispatcher - In bot.ts, set skipReplyToInMessages: !isGroup for both dispatch sites - In reply-dispatcher.ts, use sendReplyToMessageId (undefined for DMs) for message sending while keeping replyToMessageId for typing indicator
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user