Skip to content

fix(feishu): ignore reactions on other bot messages - #17812

Closed
chenydev wants to merge 1 commit into
NousResearch:mainfrom
chenydev:fix/feishu-reaction-self-bot-filter
Closed

fix(feishu): ignore reactions on other bot messages#17812
chenydev wants to merge 1 commit into
NousResearch:mainfrom
chenydev:fix/feishu-reaction-self-bot-filter

Conversation

@chenydev

Copy link
Copy Markdown

Summary

Fix Feishu reaction routing so Hermes only treats reactions on messages sent by the current Hermes bot as inbound synthetic events.

Root Cause

The Feishu reaction handler fetched the reacted-to message and only checked whether the message sender had sender_type == "app". Other Feishu bots also send messages as app senders, so user reactions on another bot's message could be routed into Hermes as reaction:added:* text.

Changes

  • Reuse a shared own-bot sender identity check for self-sent event filtering and reaction target filtering.
  • Require reacted-to messages to match the current bot open_id or user_id before routing the reaction.
  • Add regression coverage for reactions on other app messages and own app messages.

Validation

  • scripts/run_tests.sh tests/gateway/test_feishu.py

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter labels Apr 30, 2026
@chenydev

Copy link
Copy Markdown
Author

Opened tracking issue: #17847

@ygd58

ygd58 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Reviewed the fix locally. The approach of reusing the existing bot identity check (open_id / user_id comparison) for reaction target filtering is correct and consistent with how self-sent event filtering already works in the adapter. The regression tests cover the two critical cases (own bot message → route, other bot message → ignore). LGTM.

@chenydev

chenydev commented May 1, 2026

Copy link
Copy Markdown
Author

Closing this PR because the same issue has now been fixed upstream on main by #18208.

The current upstream implementation in gateway/platforms/feishu.py fetches the reacted-to message and checks the target message sender against this app's app_id, which covers the same peer-bot filtering case this PR addressed:

  • reactions on peer bot messages are ignored
  • reactions on this Hermes bot's own messages are still routed

main also includes regression coverage for those cases in tests/gateway/test_feishu.py (test_reaction_on_peer_bot_message_is_not_routed and test_reaction_on_our_own_bot_message_is_routed).

Given that, this PR is now redundant and conflicts with the newer Feishu changes, so closing it in favor of #18208.

@chenydev chenydev closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants