fix(gateway): read require_mention from config.extra for Slack adapter#6303
Closed
duan78 wants to merge 1 commit into
Closed
fix(gateway): read require_mention from config.extra for Slack adapter#6303duan78 wants to merge 1 commit into
duan78 wants to merge 1 commit into
Conversation
The Slack adapter hardcoded mention-gating behavior, ignoring the
require_mention config key that other platforms (Telegram, Discord,
WhatsApp) already support via the gateway config bridge.
Users who set slack.require_mention: false in their gateway config
expected the bot to respond to all channel messages, but it was
silently ignored because slack.py never read the bridged value
from config.extra.
Add self.config.extra.get('require_mention', True) check before
the mention-gating block. Default is True to preserve existing
behavior for users who don't set the key.
Follows the same pattern as other platform adapters.
Fixes NousResearch#6218
Contributor
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
The Slack adapter hardcoded mention-gating behavior, ignoring the
require_mentionconfig key that all other platforms (Telegram, Discord, WhatsApp, Matrix) already support via the gateway config bridge ingateway/config.py(lines 529+).Users who set
slack.require_mention: falsein their gateway config expected the bot to respond to all channel messages, but it was silently ignored becauseslack.pynever read the bridged value fromconfig.extra.Changes
gateway/platforms/slack.py: Addedself.config.extra.get("require_mention", True)check before the mention-gating block. Default isTrueto preserve existing behavior for users who don't set the key.This follows the exact same pattern used by other platform adapters.
Testing
tests/gateway/test_slack.pypass.require_mention: true).Fixes #6218