hermes - ✅(Solved) Fix [Bug] Feishu reactions on other bot messages are routed as Hermes input [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#17847Fetched 2026-05-01 05:55:35
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Root Cause

The issue is in gateway/platforms/feishu.py.

_handle_reaction_event() fetches the reacted-to message to verify whether the reaction was added to a bot message. However, the check only validates that the target message sender is an app:

sender = getattr(msg, "sender", None)
sender_type = str(getattr(sender, "sender_type", "") or "").lower()
if sender_type != "app":
    return

This filters out normal user messages, but it does not distinguish the current Hermes bot from other Feishu bots/apps in the same group.

The normal message mention gate is not involved here because im.message.reaction.created_v1 events are routed through the reaction event handler, not the regular im.message.receive_v1 path.

Fix Action

Fixed

PR fix notes

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

Description (problem / solution / changelog)

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

Changed files

  • gateway/platforms/feishu.py (modified, +5/-2)
  • tests/gateway/test_feishu.py (modified, +98/-0)

Code Example

sender = getattr(msg, "sender", None)
sender_type = str(getattr(sender, "sender_type", "") or "").lower()
if sender_type != "app":
    return

---

scripts/run_tests.sh tests/gateway/test_feishu.py
RAW_BUFFERClick to expand / collapse

Bug Description

When using the Feishu/Lark gateway, Hermes routes user reactions on messages sent by other bots in the same group as synthetic text events such as reaction:added:THUMBSUP.

This can happen even when normal group messages are correctly gated by mention or group policy, because reaction events are handled through a separate Feishu event path.

Steps to Reproduce

  1. Configure Hermes with the Feishu/Lark gateway in a group chat.
  2. Add another Feishu bot or app to the same group.
  3. Let the other bot send a message.
  4. React to that other bot's message with an emoji.
  5. Observe that Hermes receives and processes a synthetic reaction message.

Expected Behavior

Hermes should only route reactions on messages sent by the current Hermes bot.

Reactions on messages sent by other bots or apps in the same Feishu group should be ignored.

Actual Behavior

Hermes fetches the reacted-to message and only checks whether the message sender has sender_type == "app".

Since other Feishu bots also send messages as app senders, reactions on those messages can be treated as reactions on Hermes messages and routed into the agent as synthetic text.

Affected Component

Gateway: Feishu/Lark adapter

Root Cause Analysis

The issue is in gateway/platforms/feishu.py.

_handle_reaction_event() fetches the reacted-to message to verify whether the reaction was added to a bot message. However, the check only validates that the target message sender is an app:

sender = getattr(msg, "sender", None)
sender_type = str(getattr(sender, "sender_type", "") or "").lower()
if sender_type != "app":
    return

This filters out normal user messages, but it does not distinguish the current Hermes bot from other Feishu bots/apps in the same group.

The normal message mention gate is not involved here because im.message.reaction.created_v1 events are routed through the reaction event handler, not the regular im.message.receive_v1 path.

Proposed Fix

After fetching the reacted-to message, compare the target message sender identity with the current Hermes bot identity.

A reaction should only be routed when the target message sender matches the Hermes bot open_id or user_id.

This is implemented in:

Validation

The PR adds regression coverage for:

  • user reactions on another app/bot message are ignored
  • user reactions on the current Hermes bot message are still routed

Validation command:

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

extent analysis

TL;DR

To fix the issue, update the _handle_reaction_event() function in gateway/platforms/feishu.py to compare the target message sender identity with the current Hermes bot identity.

Guidance

  • Review the proposed fix in PR https://github.com/NousResearch/hermes-agent/pull/17812 to understand the changes needed.
  • Verify that the open_id or user_id of the target message sender matches the current Hermes bot identity before routing the reaction.
  • Run the validation command scripts/run_tests.sh tests/gateway/test_feishu.py to ensure the fix works as expected.
  • Check the test coverage added in the PR to ensure that user reactions on another app/bot message are ignored and reactions on the current Hermes bot message are still routed.

Example

No code snippet is provided as the issue already includes a proposed fix in the PR.

Notes

The fix relies on correctly identifying the current Hermes bot identity and comparing it with the target message sender identity. Ensure that the open_id or user_id is correctly retrieved and compared.

Recommendation

Apply the workaround by updating the _handle_reaction_event() function as proposed in the PR, as it provides a clear and tested solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug] Feishu reactions on other bot messages are routed as Hermes input [1 pull requests, 2 comments, 2 participants]