fix(feishu): add reactionNotifications mode gating (openclaw#29388) thanks @Takhoffman

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Tak Hoffman
2026-02-27 21:47:12 -06:00
committed by GitHub
parent 0e4c24ebe2
commit aef5355102
4 changed files with 63 additions and 4 deletions

View File

@@ -177,6 +177,12 @@ export async function resolveReactionSyntheticEvent(
return null;
}
const account = resolveFeishuAccount({ cfg, accountId });
const reactionNotifications = account.config.reactionNotifications ?? "own";
if (reactionNotifications === "off") {
return null;
}
// Skip bot self-reactions
if (event.operator_type === "app" || senderId === botOpenId) {
return null;
@@ -187,9 +193,7 @@ export async function resolveReactionSyntheticEvent(
return null;
}
// Fail closed if bot identity cannot be resolved; otherwise reactions on any
// message can leak into the agent.
if (!botOpenId) {
if (reactionNotifications === "own" && !botOpenId) {
logger?.(
`feishu[${accountId}]: bot open_id unavailable, skipping reaction ${emoji} on ${messageId}`,
);
@@ -201,7 +205,7 @@ export async function resolveReactionSyntheticEvent(
verificationTimeoutMs,
).catch(() => null);
const isBotMessage = reactedMsg?.senderType === "app" || reactedMsg?.senderOpenId === botOpenId;
if (!reactedMsg || !isBotMessage) {
if (!reactedMsg || (reactionNotifications === "own" && !isBotMessage)) {
logger?.(
`feishu[${accountId}]: ignoring reaction on non-bot/unverified message ${messageId} ` +
`(sender: ${reactedMsg?.senderOpenId ?? "unknown"})`,