feat(feishu): add require_mention config option for group chats - #12887
hillerliao wants to merge 2 commits into
Conversation
Add a configurable require_mention option to FeishuAdapterSettings that allows users to opt out of the @mention requirement in group chats via config.yaml. When require_mention is set to false, the bot will respond to all group messages (subject to group policy) without needing to be @mentioned. Default is true (backward-compatible).
Tests cover: - require_mention=false accepts group message without @mention - require_mention=false still enforces group allowlist policy - require_mention=true (default) still requires @mention - require_mention=false combined with allowlist blocks non-allowed users
1 similar comment
|
Current-status note for reviewer context: The underlying Feishu This PR covers the core config-file path. A newer focused implementation is also open in #17406; it keeps the default behavior unchanged, preserves the group policy / allowlist gate before bypassing mention matching, adds env-var support, updates docs, and includes broader directed unit coverage. Maintainers may want to consolidate these rather than review them independently. |
|
Thanks for the focused Feishu configuration and test coverage. This is now implemented on current
The earlier discussion correctly identified duplicate Feishu |
Feishu 群聊
require_mention配置选项允许在飞书群聊中关闭必须 @mention 机器人才能触发回复的限制。
使用方法
在
~/.hermes/config.yaml中添加:然后
hermes gateway restart重启网关即可。此配置依赖飞书平台级权限,仅修改配置不够。必须在 飞书开放平台 给应用添加以下权限:
im:message.group_msg(读取群组中所有消息)如果只具备
im:message.group_at_msg(获取 @机器人的消息),飞书服务器本身不会把非 @mention 消息转发给应用,配置无效。代码改动
FeishuAdapterSettings:新增require_mention: bool = True字段_load_settings():从extra读取require_mention,默认为true_should_accept_group_message():require_mention=False时跳过 @mention 检查但仍执行群策略测试
4 个新增测试用例全部通过(118 passing)