feat(slack): add SLACK_ALLOW_BOTS env var for bot-to-bot communication#3200
Closed
Mibayy wants to merge 1 commit into
Closed
feat(slack): add SLACK_ALLOW_BOTS env var for bot-to-bot communication#3200Mibayy wants to merge 1 commit into
Mibayy wants to merge 1 commit into
Conversation
Parity with Discord's DISCORD_ALLOW_BOTS. Three modes: SLACK_ALLOW_BOTS=none (default) — ignore all bot messages SLACK_ALLOW_BOTS=mentions — accept bot @mentions only SLACK_ALLOW_BOTS=all — accept all bot messages The self-message guard (bot_id == our own bot_id) is always active to prevent echo loops regardless of mode. Also stores self._bot_id from auth.test response for self-message detection. Closes NousResearch#3198
teknium1
pushed a commit
that referenced
this pull request
Apr 9, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR #3200 by Mibayy, adapted to current main with config.yaml
bridging support.
teknium1
pushed a commit
that referenced
this pull request
Apr 9, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR #3200 by Mibayy, adapted to current main with config.yaml
bridging support.
Contributor
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
Three modes: "none" (default, backward-compatible), "mentions" (accept
bot messages only when they @mention us), "all" (accept all bot messages
except our own, to prevent echo loops).
Configurable via:
slack:
allow_bots: mentions
Or env var: SLACK_ALLOW_BOTS=mentions
Self-message guard always active regardless of mode.
Based on PR NousResearch#3200 by Mibayy, adapted to current main with config.yaml
bridging support.
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
Closes #3198
Adds
SLACK_ALLOW_BOTSenv var to the Slack adapter, bringing it to parity withDISCORD_ALLOW_BOTS.Modes
none(default)mentionsallThe self-message guard is always active regardless of mode — the bot never processes its own messages (prevents echo loops).
Implementation
Two changes in
gateway/platforms/slack.py:1. Store
bot_idfromauth.test— used to identify our own messages:2. Replace the hard filter with the three-mode check:
Note on
SLACK_ALLOWED_USERS: bot user IDs are not subject to the allowlist check (the allowlist is applied later inhandle_messagevia the base class, keyed on theuserfield which bots don't populate). No change needed there.Tests
6 new tests in
TestMessageRouting:test_allow_bots_all_accepts_other_bottest_allow_bots_all_still_ignores_own_messagestest_allow_bots_mentions_accepts_when_mentionedtest_allow_bots_mentions_ignores_without_mentiontest_allow_bots_none_explicit_still_ignorestest_allow_bots_subtype_bot_messageAll 70 tests pass.