diff --git a/extensions/feishu/src/monitor.comment.test.ts b/extensions/feishu/src/monitor.comment.test.ts index 09136e86916..198919d5575 100644 --- a/extensions/feishu/src/monitor.comment.test.ts +++ b/extensions/feishu/src/monitor.comment.test.ts @@ -308,6 +308,18 @@ describe("resolveDriveCommentEventTurn", () => { expect(turn).toBeNull(); }); + + it("skips comment notices when bot open_id is unavailable", async () => { + const synthetic = await resolveDriveCommentSyntheticEvent({ + cfg: buildMonitorConfig(), + accountId: "default", + event: makeDriveCommentEvent(), + botOpenId: undefined, + createClient: () => makeOpenApiClient({}) as never, + }); + + expect(synthetic).toBeNull(); + }); }); describe("drive.notice.comment_add_v1 monitor handler", () => { diff --git a/extensions/feishu/src/monitor.comment.ts b/extensions/feishu/src/monitor.comment.ts index 764e3b18258..a906bbcb332 100644 --- a/extensions/feishu/src/monitor.comment.ts +++ b/extensions/feishu/src/monitor.comment.ts @@ -479,6 +479,13 @@ async function resolveDriveCommentEventCore(params: ResolveDriveCommentEventPara logger?.(`feishu[${accountId}]: unsupported drive comment notice type ${noticeType}`); return null; } + if (!botOpenId) { + logger?.( + `feishu[${accountId}]: skipping drive comment notice because bot open_id is unavailable ` + + `event=${eventId}`, + ); + return null; + } if (senderId === botOpenId) { logger?.( `feishu[${accountId}]: ignoring self-authored drive comment notice event=${eventId} sender=${senderId}`,