Skip to content

Slack: apply require_mention gating to group DMs (mpim) #7294

@mecampbellsoup

Description

@mecampbellsoup

Problem

Group DMs (channel_type: mpim) are treated identically to 1:1 DMs in the Slack adapter's message handler. The bot responds to every message in the group DM, which is noisy and distracting in multi-person conversations.

Root cause: gateway/platforms/slack.py line ~1007:

is_dm = channel_type in ("im", "mpim")

The require_mention gating at line ~1031 only applies when not is_dm, so group DMs bypass it entirely.

Expected behavior

Group DMs should respect require_mention (or a separate mpim_require_mention config), so the bot only responds when explicitly @mentioned — same as channels.

1:1 DMs should continue to respond to every message (current behavior is correct there).

Suggested approach

Either:

  1. Treat mpim as a channel for mention-gating purposes (simplest)
  2. Add a mpim_require_mention config key (more granular, lets users choose)

Option 2 is probably better since some users may want the current behavior in small group DMs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliveryplatform/slackSlack app adaptertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions