fix(feishu): support Lark private chats as direct messages (openclaw#31400) thanks @stakeswky

Verified:
- pnpm test -- extensions/feishu/src/bot.checkBotMentioned.test.ts
- pnpm build
- pnpm check (blocked by unrelated baseline lint errors in untouched files)
- pnpm test:macmini (not run after pnpm check blocked)

Co-authored-by: stakeswky <64798754+stakeswky@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
不做了睡大觉
2026-03-03 07:04:42 +08:00
committed by GitHub
parent 36c6b63ea6
commit 3043e68dfa
6 changed files with 10 additions and 7 deletions

View File

@@ -165,7 +165,7 @@ export type FeishuMessageEvent = {
root_id?: string;
parent_id?: string;
chat_id: string;
chat_type: "p2p" | "group";
chat_type: "p2p" | "group" | "private";
message_type: string;
content: string;
create_time?: string;
@@ -709,6 +709,7 @@ export async function handleFeishuMessage(params: {
let ctx = parseFeishuMessageEvent(event, botOpenId);
const isGroup = ctx.chatType === "group";
const isDirect = !isGroup;
const senderUserId = event.sender.sender_id.user_id?.trim() || undefined;
// Handle merge_forward messages: fetch full message via API then expand sub-messages
@@ -895,7 +896,7 @@ export async function handleFeishuMessage(params: {
senderName: ctx.senderName,
}).allowed;
if (!isGroup && dmPolicy !== "open" && !dmAllowed) {
if (isDirect && dmPolicy !== "open" && !dmAllowed) {
if (dmPolicy === "pairing") {
const { code, created } = await pairing.upsertPairingRequest({
id: ctx.senderOpenId,