Skip to content

feat(feishu): add ignore_at_all config to opt out of @everyone triggering the bot - #60910

Open
glow1128 wants to merge 1 commit into
NousResearch:mainfrom
glow1128:feat/feishu-ignore-at-all
Open

feat(feishu): add ignore_at_all config to opt out of @everyone triggering the bot#60910
glow1128 wants to merge 1 commit into
NousResearch:mainfrom
glow1128:feat/feishu-ignore-at-all

Conversation

@glow1128

@glow1128 glow1128 commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Add an ignore_at_all configuration 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 @everyone placeholder) as equivalent to an explicit @bot mention. 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 @bot mentions.

Changes

  • plugins/platforms/feishu/adapter.py:

    • Add ignore_at_all: bool = False to FeishuAdapterSettings (default: False, backward compatible)
    • Add FEISHU_IGNORE_AT_ALL env var support in FeishuAdapter._load_settings()
    • Add ignore_at_all config key support via extra.get("ignore_at_all", ...)
    • Apply setting in _apply_settings()self._ignore_at_all
    • Gate the @_all check in _mentions_self() on not self._ignore_at_all
  • tests/gateway/test_feishu.py:

    • Add TestIgnoreAtAll test class with 4 tests:
      • test_ignore_at_all_rejects_at_everyone_message@_all is rejected when ignore_at_all=true
      • test_default_ignore_at_all_false_accepts_at_everyone — default behavior preserved
      • test_ignore_at_all_does_not_affect_explicit_bot_mention — direct @bot still works
      • test_ignore_at_all_does_not_affect_dm — DMs bypass mention gate regardless
  • website/docs/user-guide/messaging/feishu.md:

    • Add "Ignoring @everyone" section documenting the new config
  • website/i18n/zh-Hans/.../feishu.md:

    • Add corresponding Chinese documentation

Configuration

# config.yaml
feishu:
  ignore_at_all: true

Or via environment variable:

FEISHU_IGNORE_AT_ALL=true

Behavior when ignore_at_all=true

  • @所有人 / @everyone messages are not treated as mentioning the bot.
  • Direct @bot mentions still work as expected.
  • DMs are unaffected (they always bypass the mention gate).
  • The group policy (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.

…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
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins platform/feishu Feishu / Lark adapter P3 Low — cosmetic, nice to have labels Jul 8, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing with #59347 for the same issue (#33723). This PR (#60910) makes the @everyone behavior configurable (ignore_at_all, default off, backward-compatible), whereas #59347 removes the @_all self-mention branch unconditionally. Cross-linking so a maintainer can pick the preferred approach; not a duplicate.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@glow1128

glow1128 commented Jul 8, 2026

Copy link
Copy Markdown
Author

Comparison with #59347

Thanks 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:

#59347 (unconditional removal) #60910 (configurable, this PR)
Default behavior Breaking: @所有人 no longer triggers the bot Preserved: @所有人 still triggers the bot (backward compatible)
Opt-in/opt-out No choice — always ignored ignore_at_all: true to opt out
Use cases covered Only "never respond to @everyone" Both "respond to @everyone" and "ignore @everyone"
Lines changed 2 additions, 3 deletions 127 additions, 1 deletion
Risk Low (simple deletion) Low (additive, default-off config)

Why configurable is the safer default

Some deployments intentionally want the bot to respond to @所有人 — for example, a dedicated support channel where the bot should acknowledge every announcement. Removing the feature unconditionally in #59347 breaks that use case with no migration path.

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 @_all triggers the bot, then remove in a future release) rather than a silent behavior change.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: true path is not currently wired. The plugin YAML bridge at plugins/platforms/feishu/adapter.py:5618-5627 handles only allow_bots, and the generic bridge in gateway/config.py:1164-1250 does not include ignore_at_all. The added tests cover only FEISHU_IGNORE_AT_ALL, so this regression is not detected.
  • Add FEISHU_IGNORE_AT_ALL to both existing environment-variable tables (website/docs/user-guide/messaging/feishu.md:539-558 and the zh-Hans counterpart at :482-500).

Suggested changes

  • Bridge feishu.ignore_at_all into the adapter configuration, and add a load_gateway_config() integration test using a temporary HERMES_HOME.

Automated hermes-sweeper review.


```yaml
# config.yaml
feishu:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 10, 2026
DavidMetcalfe added a commit to DavidMetcalfe/hermes-agent that referenced this pull request Aug 27, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants