Skip to content

feat(slack): add per-channel natural thread routing - #73851

Open
KCAYAAI wants to merge 2 commits into
NousResearch:mainfrom
KCAYAAI:feat/slack-natural-thread-channels
Open

KCAYAAI wants to merge 2 commits into
NousResearch:mainfrom
KCAYAAI:feat/slack-natural-thread-channels

Conversation

@KCAYAAI

@KCAYAAI KCAYAAI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add slack.natural_thread_channels, a per-channel routing control for Slack workspaces that need mention-to-start, then natural thread replies in selected collaboration channels while keeping strict mention-only behavior everywhere else.

The option is empty by default and does not change existing installations.

Problem

The existing controls operate at the wrong scope for this workflow:

  • strict_mention: false or thread_require_mention: false weakens thread gating across the whole Slack profile.
  • free_response_channels also admits unmentioned top-level messages, so it cannot express “mention to start.”
  • require_mention_channels tightens channels; it does not provide a channel-scoped exception to strict thread gating.

Multi-agent and shared-workspace deployments therefore have to choose between repetitive mentions in designated collaboration threads or profile-wide auto-follow behavior in unrelated channels.

Behavior

slack:
  require_mention: true
  strict_mention: true
  thread_require_mention: true
  natural_thread_channels:
    - C0123456789

For a listed channel:

  1. An unmentioned top-level message is ignored, including when the profile is otherwise free-response.
  2. An explicit bot mention starts engagement and records the thread.
  3. Plain human replies in that engaged thread can continue naturally.
  4. Existing bot-message, active-session, parent-mention, authorization, allowed-channel, and bot-loop protections continue to apply.

For every unlisted channel, the existing strict_mention and thread_require_mention behavior is unchanged.

Changes

  • Bridge natural_thread_channels from config.yaml into the Slack adapter.
  • Compute strict/thread mention policy per channel instead of weakening profile-wide booleans.
  • Force the top-level mention gate for listed channels, even if they overlap a free-response setting.
  • Add routing tests for YAML/list/CSV parsing, mention-to-start, natural thread follow-up, free-response precedence, and strict unlisted channels.
  • Document the option and its relationship to the existing mention controls.

Related mention-routing PRs

Validation

  • Focused routing suite: 97 passed
  • All 32 Slack test files: 893 passed
  • Ruff: passed
  • git diff --check: passed
  • Docusaurus production build: passed for English and zh-Hans

The Slack-wide suite retains 37 existing non-failing asynchronous mock cleanup warnings.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused Slack routing change. Current main still globally rejects unmentioned messages at plugins/platforms/slack/adapter.py:5693-5716 when strict_mention or thread_require_mention applies, so the requested per-channel natural-thread behavior remains needed. I found no correctness defect in the proposed routing path.

Suggested changes

  • Add natural_thread_channels: "" to the Slack defaults in hermes_cli/config_defaults.py:1783-1797, alongside the existing Slack routing controls. The adapter has a safe empty fallback, but the canonical defaults should enumerate the documented configuration surface.

Automated hermes-sweeper review.

@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter P3 Low — cosmetic, nice to have labels Jul 30, 2026
@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/slack Slack app adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants