feat(feishu): add ignore_at_all config to opt out of @everyone triggering the bot - #60910
feat(feishu): add ignore_at_all config to opt out of @everyone triggering the bot#60910glow1128 wants to merge 1 commit into
Conversation
…ring the bot When a Feishu group message uses @所有人 (@everyone), Hermes currently treats it as a bot mention and responds. This adds an ignore_at_all config (default: false, backward-compatible) so users can opt out. Config: - config.yaml: feishu.ignore_at_all: true - env var: FEISHU_IGNORE_AT_ALL=true When enabled: - @所有人 no longer counts as mentioning the bot - Direct @bot mentions still work - DMs are unaffected - Group policy (open/allowlist/disabled) still enforced
Competing with #59347 for the same issue (#33723). This PR (#60910) makes the @everyone behavior configurable ( |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (token read-only - maintainer approval needed)
PR 60910 adds an ignore_at_all configuration option to the Feishu integration, allowing users to opt out of bot responses when @everyone or @channel is used. Well-scoped (4 files, 127 additions, 1 deletion). No security issues, debug artifacts, or quality concerns detected. Implementation follows existing config patterns in the codebase.
LGTM - awaiting maintainer approval.
Comparison with #59347Thanks to the triage bot for cross-linking. Both PRs address #33723 — here is a summary of the tradeoffs so a maintainer can pick the preferred approach:
Why configurable is the safer defaultSome deployments intentionally want the bot to respond to This PR keeps the existing behavior as the default and adds an escape hatch for users who find it noisy. The cost is a few extra lines of config wiring + tests, but the benefit is zero breakage for existing users. If a maintainer prefers the unconditional approach, I am happy to rework this PR to match — but I would recommend at minimum a deprecation period (e.g., log a warning when |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (127 additions — Feishu ignore_at_all config to opt out of @everyone)
Scope
Adds ignore_at_all config option for Feishu to opt out of @everyone notifications.
Observations
- Platform-specific quality-of-life feature.
- The existing 1 review is a COMMENT-only (not APPROVED) — this is a fresh formal review.
- Well-scoped addition with a clear user benefit.
Recommendation
Human reviewer familiar with Feishu bot behavior should confirm the config properly gates @everyone without breaking other at-mentions.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for preserving the existing default while adding the requested opt-out. The underlying behavior is present on current main: plugins/platforms/feishu/adapter.py:4331-4335 classifies @_all as a self-mention, and _admit() applies that result at :4274.
Problems
- The documented
feishu.ignore_at_all: truepath is not currently wired. The plugin YAML bridge atplugins/platforms/feishu/adapter.py:5618-5627handles onlyallow_bots, and the generic bridge ingateway/config.py:1164-1250does not includeignore_at_all. The added tests cover onlyFEISHU_IGNORE_AT_ALL, so this regression is not detected. - Add
FEISHU_IGNORE_AT_ALLto both existing environment-variable tables (website/docs/user-guide/messaging/feishu.md:539-558and the zh-Hans counterpart at:482-500).
Suggested changes
- Bridge
feishu.ignore_at_allinto the adapter configuration, and add aload_gateway_config()integration test using a temporaryHERMES_HOME.
Automated hermes-sweeper review.
|
|
||
| ```yaml | ||
| # config.yaml | ||
| feishu: |
There was a problem hiding this comment.
This documented top-level YAML key is not wired by the current Feishu configuration bridge: _apply_yaml_config() only handles allow_bots (plugins/platforms/feishu/adapter.py:5618-5627), and the shared gateway bridge has no ignore_at_all key. Please add that bridge and a load_gateway_config() regression test.
…oad_gateway_config Covers the gap the NousResearch#60910 review identified: the documented YAML key must reach FEISHU_IGNORE_AT_ALL through the real gateway config load path, not just the adapter's unit-level bridge.
Summary
Add an
ignore_at_allconfiguration option to the Feishu gateway adapter, allowing users to prevent@所有人(@everyone) from counting as a bot mention in group chats.By default, the bot still responds to
@所有人(backward compatible), but this can be turned off via config or environment variable.Motivation
Currently, the Feishu bot responds to
@所有人(@everyone) messages in groups because_mentions_self()treats@_all(Feishu's internal@everyoneplaceholder) as equivalent to an explicit@botmention. This is often undesirable — group admins frequently use@所有人for announcements that are not directed at the bot, causing unnecessary and noisy responses.Users should be able to opt out of this behavior so the bot only responds to explicit
@botmentions.Changes
plugins/platforms/feishu/adapter.py:ignore_at_all: bool = FalsetoFeishuAdapterSettings(default:False, backward compatible)FEISHU_IGNORE_AT_ALLenv var support inFeishuAdapter._load_settings()ignore_at_allconfig key support viaextra.get("ignore_at_all", ...)_apply_settings()→self._ignore_at_all@_allcheck in_mentions_self()onnot self._ignore_at_alltests/gateway/test_feishu.py:TestIgnoreAtAlltest class with 4 tests:test_ignore_at_all_rejects_at_everyone_message—@_allis rejected whenignore_at_all=truetest_default_ignore_at_all_false_accepts_at_everyone— default behavior preservedtest_ignore_at_all_does_not_affect_explicit_bot_mention— direct@botstill workstest_ignore_at_all_does_not_affect_dm— DMs bypass mention gate regardlesswebsite/docs/user-guide/messaging/feishu.md:website/i18n/zh-Hans/.../feishu.md:Configuration
Or via environment variable:
Behavior when
ignore_at_all=true@所有人/@everyonemessages are not treated as mentioning the bot.@botmentions still work as expected.open/allowlist/disabled) is still enforced independently.Backward Compatibility
Fully backward compatible. Default is
ignore_at_all: false, preserving existing behavior where@所有人counts as a bot mention.