feat(feishu): add per-group require_mention flag - #11193
Closed
JerryRobocat wants to merge 1 commit into
Closed
Conversation
Adds an opt-in `require_mention: false` per-group setting for Feishu
group rules. When set, the bot processes every message in that group
without requiring an @mention — useful for solo bot-user groups or
dedicated topic channels where you want DM-like behaviour.
Default remains True, so existing team/multi-person groups keep the
safe mention-gated behaviour unchanged. The policy/allowlist/blacklist
gate still applies, so a blacklisted sender is still rejected even
with mention gate bypassed.
Example config:
feishu:
group_rules:
oc_solo_topic:
policy: open
require_mention: false
oc_team_chat:
policy: open # require_mention defaults to true
Tests:
- New test covers mention-gate bypass for opt-in group
- Verifies default (require_mention: true) groups still gate
- Verifies policy gate still applies when bypass is on
Author
|
Closing for now — going to soak this locally for a few days before re-opening once the behaviour is polished. Local patch is staying applied on my machine to exercise it in real use. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in
require_mention: falseper-group setting for Feishu group rules. When set, the bot processes every message in that group without requiring an @mention — useful for solo bot-user groups or dedicated topic channels where you want DM-like behaviour without the ceremony of @-mentioning the bot every message.Default remains
True, so existing team/multi-person groups keep the safe mention-gated behaviour unchanged.Motivation
In Feishu, group chats require an explicit @mention of the bot for messages to reach the agent — this is the correct default for shared/team groups. But users often want dedicated topic channels (just themselves + the bot) to organise parallel conversations on different projects. In those solo-with-bot groups, having to @-mention the bot for every single message is friction-heavy.
This change lets users opt specific groups out of the mention gate via a single config flag, while keeping the default safe for all existing groups.
Changes
FeishuGroupRuledataclass gains arequire_mention: bool = TruefieldFeishuAdapter._load_settings()parses the new field fromgroup_rulesconfig_should_accept_group_message()checks the flag after the policy gate and bypasses mention checking when opted outExample config
Tests
tests/gateway/test_feishu.py::FeishuAdapterTests::test_per_group_require_mention_false_bypasses_mention_gate(new)tests/gateway/test_feishu.pysuite: 107 passed