Skip to content

feat(discord): add per-channel auto-thread exclusion list - #4611

Closed
Helmi wants to merge 1 commit into
NousResearch:mainfrom
Helmi:feat/discord-no-auto-thread-channels
Closed

feat(discord): add per-channel auto-thread exclusion list#4611
Helmi wants to merge 1 commit into
NousResearch:mainfrom
Helmi:feat/discord-no-auto-thread-channels

Conversation

@Helmi

@Helmi Helmi commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a discord.no_auto_thread_channels config option that lets users exclude specific channels from auto-threading while keeping it enabled globally.

Motivation

When discord.auto_thread is enabled, every @mention in a text channel spawns a new thread. This is great for most channels (keeps conversations isolated), but some channels — like shared collaboration channels with multiple bots or group discussion channels — work better without auto-threading.

Currently the only option is to disable auto_thread globally, which is all-or-nothing.

Changes

  • gateway/platforms/discord.py: Check DISCORD_NO_AUTO_THREAD_CHANNELS env var before creating auto-threads. If the message's channel ID is in the exclusion list, skip thread creation.
  • gateway/config.py: Bridge discord.no_auto_thread_channels from config.yaml to the DISCORD_NO_AUTO_THREAD_CHANNELS env var. Supports both YAML list and comma-separated string formats (same pattern as free_response_channels).
  • tests/gateway/test_discord_free_response.py: Two new tests — one verifying excluded channels skip auto-threading, one verifying non-excluded channels still auto-thread normally.

Usage

# config.yaml
discord:
  auto_thread: true
  no_auto_thread_channels:
    - '1489269514184032318'  # shared bot collaboration channel

Or via env var:

DISCORD_NO_AUTO_THREAD_CHANNELS=1489269514184032318,1234567890

Tests

All 17 tests in test_discord_free_response.py pass (including 2 new ones).

Add discord.no_auto_thread_channels config option (also settable via
DISCORD_NO_AUTO_THREAD_CHANNELS env var) that accepts a comma-separated
list of channel IDs where auto-threading should be skipped.

This is useful when auto_thread is globally enabled but certain channels
(e.g. shared bot-to-bot collaboration channels) should keep conversations
in the main channel instead of splitting them into threads.

Follows the same pattern as discord.free_response_channels — accepts
both YAML list and comma-separated string formats in config.yaml.
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution! This functionality is already available on main via discord.no_thread_channels (and the DISCORD_NO_THREAD_CHANNELS env var), which was added after this PR was opened.

Evidence:

  • gateway/config.py lines 652–657 — bridges discord.no_thread_channels from config.yaml to DISCORD_NO_THREAD_CHANNELS, supporting both YAML list and comma-separated string (same pattern as free_response_channels)
  • gateway/platforms/discord.py lines 3251–3256 — reads DISCORD_NO_THREAD_CHANNELS and sets skip_thread = True for matching channel IDs before the auto_thread branch fires, producing identical behavior to what this PR implements
  • Introduced by commit f6d4b6a3198b35e2ee340c617b2f3193a9ab727b (feat(discord): add ignored_channels and no_thread_channels config)

Usage with the existing feature:

discord:
  auto_thread: true
  no_thread_channels:
    - '1489269514184032318'

This is an automated hermes-sweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants