Skip to content

[Bug]: Feishu group messages never reach gateway — DM works fine but @mention in group produces zero response #6889

@javamagong

Description

@javamagong

Bug Description

Hermes Agent Feishu DM works perfectly, but @mentioning the bot in a group chat produces zero response — group messages never reach the gateway at all.

Steps to Reproduce

  1. Configure Feishu bot, DM works fine
  2. Add the bot to a Feishu group
  3. @mention the bot in the group
  4. Bot is silent, no group messages appear in gateway logs

Expected Behavior

When @mentioned in a group, the gateway should receive and process the message and respond in the group chat.

Actual Behavior

  • DM (p2p) messaging: fully functional
  • Group messages never appear in gateway logs
  • Logs only show im.chat.access_event.bot_p2p_chat_entered_v1 errors — no group events at all

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

N/A (CLI only)

Operating System

Ubuntu 24.04

Python Version

3.11.9

Hermes Version

2.1.0

Relevant Logs / Traceback

[Lark] [2026-04-10 08:21:18,463] WARNING Unable to hydrate bot identity from application info. Grant admin:app.info:readonly...
[Feishu] Connected in websocket mode (feishu)
# Group message logs: completely blank — group chat_id never appears

Root Cause Analysis (optional)

  1. Group event handlers not registered (gateway/platforms/feishu.py lines 1183-1185):
  • Only p2_im_chat_access_event_bot_p2p_chat_entered_v1 (p2p enter) is registered
  • Missing im.chat.access_event.bot_chat_access_v1 (group access event)
  • Missing im.chat.member.bot.added_v1 / im.chat.member.bot.deleted_v1 (bot added/removed events)
  1. Bot identity not resolved — _hydrate_bot_identity() fails due to missing admin:app.info:readonly permission, causing _should_accept_group_message() to fail to recognize @mentions correctly

  2. Group message policy defaults to deny — FEISHU_GROUP_POLICY defaults to allowlist with empty FEISHU_ALLOWED_USERS, so even if messages reached gateway they'd be rejected

Proposed Fix (optional)

  1. Add group event handlers in feishu.py event registration:
  • .register_p2_im_chat_access_event_bot_chat_access_v1(self._on_bot_chat_access)
  • .register_p2_im_chat_member_bot_added_v1(self._on_bot_added_to_chat)
  • .register_p2_im_chat_member_bot_deleted_v1(self._on_bot_removed_from_chat)
  1. Manually configure bot identity in ~/.hermes/.env:

FEISHU_BOT_OPEN_ID=ou_xxx
FEISHU_BOT_NAME=BotName

  1. Set FEISHU_GROUP_POLICY=open as a temporary workaround

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions