fix(slack): honor disable_dms setting - #53030
Closed
vexclawx31 wants to merge 1 commit into
Closed
Conversation
vexclawx31
force-pushed
the
fix/slack-disable-dms
branch
from
June 26, 2026 10:55
a0db0c6 to
5565a3d
Compare
teknium1
reviewed
Jul 15, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracing the missing configuration bridge; the underlying 1:1-DM gap is present on current main.
Problems
plugins/platforms/slack/adapter.py:2527gates onis_dm, which includes bothimandmpim. That suppresses MPIM group-DM messages before normal routing. Current documentation defines MPIMs as shared surfaces that retain channel-style mention and allowlist controls (website/docs/user-guide/messaging/slack.md:419), and current main distinguishes one-to-one DMs withis_one_to_one_dm(plugins/platforms/slack/adapter.py:2835).- The new slash-command check only recognizes
D-prefixed channels, so MPIM message events and slash commands would be handled inconsistently.
Suggested changes
- Limit this setting to
channel_type == "im"/is_one_to_one_dm, then add an MPIM regression test proving group routing is unchanged. - Document
slack.disable_dmsin the Slack messaging guide.
Automated hermes-sweeper review.
| if not channel_type and channel_id.startswith("D"): | ||
| channel_type = "im" | ||
| is_dm = channel_type in {"im", "mpim"} # Both 1:1 and group DMs | ||
| if is_dm and self._slack_disable_dms(): |
Contributor
There was a problem hiding this comment.
is_dm includes mpim, so this also drops group-DM messages before their established shared-surface mention/allowlist routing. Please gate only one-to-one im DMs (or consistently extend the policy and document/test MPIM behavior); the slash-command path currently recognizes only D IDs.
Contributor
|
Merged via #70196 — your commit was cherry-picked/reapplied onto current main with your authorship preserved in git history: your disable_dms enforcement was cherry-picked. Thanks for the contribution! |
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
slack.disable_dmsorSLACK_DISABLE_DMSis enabledWhy
Slack channel allowlists intentionally do not filter DMs, but operators may configure external/project-scoped agents to avoid DMs. The existing
disable_dmssetting could be present in config/env without being enforced by the Slack adapter.Test plan
/Users/vex/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_slack.py -k 'disable_dms or dm_slash_command_keeps_dm_session_semantics or plain_slash_still_works' -q -o 'addopts='python3 -m py_compile plugins/platforms/slack/adapter.py tests/gateway/test_slack.pygit diff --check