Skip to content

fix(slack): respect require_mention config for channel messages#6268

Closed
giwaov wants to merge 1 commit into
NousResearch:mainfrom
giwaov:fix/6218-slack-require-mention
Closed

fix(slack): respect require_mention config for channel messages#6268
giwaov wants to merge 1 commit into
NousResearch:mainfrom
giwaov:fix/6218-slack-require-mention

Conversation

@giwaov

@giwaov giwaov commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The Slack adapter had mention gating hardcoded - it always required @mention in channels regardless of the require_mention config setting. The setting was properly stored in config.extra by gateway/config.py (lines 529-535) but never consulted by the Slack adapter's message routing logic.

Changes

gateway/platforms/slack.py

  • Read self.config.extra.get('require_mention', True) before the mention gating check
  • Skip mention gating when require_mention is false, allowing the bot to respond to all channel messages

tests/gateway/test_slack.py

  • Added two tests covering both require_mention: true (default) and require_mention: false behavior

Root Cause

In gateway/platforms/slack.py, the channel message filter was:

\\python
if not is_dm and bot_uid and not is_mentioned:
# check thread/session fallbacks...
return # ignore if none match
\\

This blocked all non-mention channel messages unconditionally. The fix adds:

\\python
require_mention = self.config.extra.get('require_mention', True)
if not is_dm and bot_uid and not is_mentioned and require_mention:
\\

Config Example

\\yaml
slack:
require_mention: false # respond to all channel messages without @mention
\\

Closes #6218

The Slack adapter had mention gating hardcoded - it always required
@mention in channels regardless of config. The require_mention setting
was properly stored in config.extra by gateway/config.py but never read
by the Slack adapter.

Now reads self.config.extra.get('require_mention', True) and skips
mention gating when set to false, allowing the bot to respond to all
channel messages without requiring @mention.

Closes NousResearch#6218
@teknium1

teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #6809 as part of a consolidated Slack adapter improvement. Your contribution was superseded by #5885's more complete implementation. Your authorship is preserved in git history. Thank you @giwaov for your work on this!

@teknium1 teknium1 closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack adapter ignores require_mention: false config for channel messages

2 participants