Skip to content

feat(feishu): add require_mention and free_response_chats config for group messages - #15058

Closed
batmanhz wants to merge 1 commit into
NousResearch:mainfrom
batmanhz:feat/feishu-require-mention
Closed

feat(feishu): add require_mention and free_response_chats config for group messages#15058
batmanhz wants to merge 1 commit into
NousResearch:mainfrom
batmanhz:feat/feishu-require-mention

Conversation

@batmanhz

Copy link
Copy Markdown

Summary

Align Feishu platform with other messaging platforms (Telegram, Discord, WhatsApp) by introducing a configurable mention requirement for group messages.

Changes

1. New Configuration Options

  • require_mention (default: true): Controls whether group messages must @mention the bot to trigger processing.
  • free_response_chats (default: []): Whitelist of specific group chat IDs that bypass both mention and user allowlist checks.

2. Configuration Support

  • YAML config: feishu.require_mention, feishu.free_response_chats
  • Environment variables: FEISHU_REQUIRE_MENTION, FEISHU_FREE_RESPONSE_CHATS

3. Files Modified

  • gateway/platforms/feishu.py: Added settings, parsing, and updated _should_accept_group_message logic.
  • gateway/config.py: Added free_response_chats to the platform config bridge.
  • hermes_cli/config.py: Added new env vars to known keys.
  • tests/gateway/test_feishu.py: Updated and added tests for the new behavior.

4. Usage Example

# config.yaml
feishu:
  require_mention: true  # Other groups still require @mention
  free_response_chats:
  - oc_6c6f73affa82ede1696fb7d8bcda4f1a  # This group bypasses all checks

5. Testing

All 189 Feishu tests pass locally.

…group messages

Align Feishu platform with other messaging platforms (Telegram, Discord,
WhatsApp) by introducing a configurable mention requirement for group
messages.

- Add 'require_mention' config (default: true) to control whether
  group messages must @mention the bot to trigger processing.
- Add 'free_response_chats' config to whitelist specific group chats
  that bypass both mention and user allowlist checks.
- Support both YAML config (feishu.require_mention,
  feishu.free_response_chats) and env vars (FEISHU_REQUIRE_MENTION,
  FEISHU_FREE_RESPONSE_CHATS).
- Update gateway config loader to map free_response_chats from YAML
  to platform extra dict.
- Update tests to cover new mention bypass and free-response chat
  scenarios.
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 24, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the Feishu group-routing contribution. This is an automated hermes-sweeper review; current main already provides the requested behavior through the maintained Feishu admission policy.

  • plugins/platforms/feishu/adapter.py:1600 resolves global require_mention from platform config or FEISHU_REQUIRE_MENTION; :4274 applies it in the live group-admission path.
  • plugins/platforms/feishu/adapter.py:421 and :4278 provide per-chat group_rules.<chat_id>.require_mention overrides. A rule with policy: open and require_mention: false is the maintained equivalent of a free-response chat: it admits that chat without requiring a mention or the default user allowlist.
  • The documented oc_free_chat example is at website/docs/user-guide/messaging/feishu.md:514, and coverage exists in tests/gateway/test_feishu_bot_admission.py:100 and :114.
  • This fuller implementation landed in b94cb8e2c4e (feat(feishu): operator-configurable bot admission and mention policy) and shipped in v2026.5.7. The linked issue Feishu group messages ignore require_group_mention=false from config.yaml #15226 was also closed as resolved on current main.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 12, 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 sweeper:implemented-on-main Sweeper: behavior already present on current main type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants