hermes-agent/website/docs/user-guide/messaging
Victor Kyriazakos accd672054 fix(slack): MPIMs (group DMs) obey shared-surface mention gating + reaction guard
Group DMs (MPIMs) were classified as DMs and thereby exempted from every
operator control that shared surfaces are supposed to honor: allowed_channels,
require_mention, strict_mention, free_response_channels, and the reaction
guard. Symptom: the bot added 👀/ to unmentioned MPIM
messages and still invoked the agent (which then returned NO_REPLY) instead of
the gateway dropping the event before model execution. Removing an MPIM from
allowed_channels did not disable it.

Root cause is the DM classification at adapter.py:
    is_dm = channel_type in {"im", "mpim"}
used for BOTH routing exemptions and reaction gating. An MPIM is a shared
surface (multiple humans can see and trigger the bot), not a private 1:1 DM,
so it must be gated like a channel.

This behavior was introduced/reinforced by a trail of Slack group-DM PRs:
- #4633  fix(slack): treat group DMs (mpim) like DMs + reaction guard
- #54632 fix(slack): subscribe to message.mpim + mpim scopes so group DMs work
- #54663 fix(slack): group DMs work OOTB + reinstall nudge
#54632/#54663 correctly made MPIM messages *reachable*; #4633 over-reached by
giving them the DM mention/reaction *exemptions*. This corrects only that
over-reach.

Fix (minimal): introduce `is_one_to_one_dm = channel_type == "im"` and key the
two EXEMPTION sites off it instead of `is_dm`:
- mention/allowlist gating block (`if not is_one_to_one_dm and bot_uid:`)
- reaction guard (`(is_one_to_one_dm or is_mentioned)`)
`is_dm` is intentionally retained for session/thread scoping and chat_type
labeling, where treating an MPIM as a persistent multi-party conversation is
correct — only the mention/reaction exemptions were wrong.

Docs: slack.md now distinguishes 1:1 DMs (mention-exempt) from group DMs
(shared surface; obey require_mention/strict_mention/allowed_channels/
free_response_channels; reactions only when @mentioned).

Tests: +7 in test_slack_mention.py (MPIM unmentioned dropped under
require_mention and strict_mention; MPIM mentioned processed; MPIM off
allowed_channels dropped; MPIM in free_response opted in; 1:1 IM still exempt;
reaction guard drops unmentioned MPIM). Updated _would_process to model the
is_one_to_one_dm gating + strict_mention. 72 passed.
2026-07-03 12:34:53 +05:30
..
_category_.json
bluebubbles.md
dingtalk.md docs: stop recommending pip install; curl installer is the only supported path (#51743) 2026-06-24 00:14:32 -07:00
discord.md docs: reconcile docs with code across last 3 releases (#54254) 2026-06-28 12:47:50 -07:00
email.md Make email pairing opt-in 2026-06-21 22:43:57 -07:00
feishu.md
google_chat.md
homeassistant.md fix(docs): remove non-existent conversation_entity setting from homeassistant troubleshooting 2026-06-20 20:42:49 -07:00
index.md feat(gateway): per-platform typing_indicator toggle 2026-06-29 21:12:57 -07:00
irc.md docs: reconcile docs with code across last 3 releases (#54254) 2026-06-28 12:47:50 -07:00
line.md
matrix.md docs: stop recommending pip install; curl installer is the only supported path (#51743) 2026-06-24 00:14:32 -07:00
mattermost.md
msgraph-webhook.md
ntfy.md docs: reconcile docs with code across last 3 releases (#54254) 2026-06-28 12:47:50 -07:00
open-webui.md chore(scripts): drop Open WebUI local bootstrap script (#56178) 2026-07-01 01:30:40 -07:00
photon.md
qqbot.md
raft.md
signal.md
simplex.md docs: reconcile docs with code across last 3 releases (#54254) 2026-06-28 12:47:50 -07:00
slack.md fix(slack): MPIMs (group DMs) obey shared-surface mention gating + reaction guard 2026-07-03 12:34:53 +05:30
sms.md docs: stop recommending pip install; curl installer is the only supported path (#51743) 2026-06-24 00:14:32 -07:00
teams-meetings.md
teams.md
telegram.md fix(telegram): gate rich draft previews separately 2026-06-24 18:11:14 -07:00
webhooks.md docs(webhook): clarify authenticated != trusted-content trust model (#53562) 2026-06-27 03:43:33 -07:00
wecom-callback.md
wecom.md
weixin.md docs: stop recommending pip install; curl installer is the only supported path (#51743) 2026-06-24 00:14:32 -07:00
whatsapp-cloud.md
whatsapp.md
yuanbao.md