feishu: fall back to user_id for inbound sender identity (openclaw#26703) thanks @NewdlDewdl

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: NewdlDewdl <230946873+NewdlDewdl@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Rohin
2026-02-27 22:59:42 -06:00
committed by GitHub
parent f29c642c13
commit e0b1b48be3
3 changed files with 42 additions and 13 deletions

View File

@@ -59,6 +59,15 @@ describe("parseFeishuMessageEvent mentionedBot", () => {
expect(ctx.mentionedBot).toBe(false);
});
it("falls back to sender user_id when open_id is missing", () => {
const event = makeEvent("p2p", []);
(event as any).sender.sender_id = { user_id: "u_mobile_only" };
const ctx = parseFeishuMessageEvent(event as any, BOT_OPEN_ID);
expect(ctx.senderOpenId).toBe("u_mobile_only");
expect(ctx.senderId).toBe("u_mobile_only");
});
it("returns mentionedBot=true when bot is mentioned", () => {
const event = makeEvent("group", [
{ key: "@_user_1", name: "Bot", id: { open_id: BOT_OPEN_ID } },