feat(discord): allow auto-thread in free-response channels - #19131
Closed
stoicborg wants to merge 1 commit into
Closed
feat(discord): allow auto-thread in free-response channels#19131stoicborg wants to merge 1 commit into
stoicborg wants to merge 1 commit into
Conversation
Previously `free_response_channels` implicitly disabled auto-thread because `skip_thread` included `or is_free_channel`. This prevented small private servers (where mention requirements are relaxed via `free_response_channels: "*"`) from benefiting from per-conversation thread isolation. Remove the `is_free_channel` condition from `skip_thread` so that auto-thread and free-response are orthogonal features. Users who want no threads in specific free-response channels can still use `no_thread_channels`.
Collaborator
1 similar comment
Collaborator
13 tasks
Author
This was referenced May 15, 2026
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.
What
Adds an opt-in
auto_thread_in_free_response_channelssetting so that free-response channels can still benefit from auto-thread isolation.Problem
Currently,
free_response_channelsimplicitly disables auto-thread because theskip_threadcheck includesis_free_channel. This means private servers (where all channels are free-response and no mention is required) lose per-conversation thread isolation entirely.Use Case: Private Discord Servers
This feature is designed for small, private Discord servers where:
@mentions(viafree_response_channels: "*")Example: In a
#generalchannel, you ask the bot about coding at 9am, then about trip planning at 2pm. Without threads, the 2pm trip response is contaminated by the 9am coding context. Withauto_thread_in_free_response_channels: true, each interaction spins up its own thread, keeping contexts clean and isolated while reducing long-context token consumption.Solution
discord.auto_thread_in_free_response_channelsinconfig.yamlDISCORD_AUTO_THREAD_IN_FREE_RESPONSE_CHANNELSenv var (env takes precedence)false— existing behaviour is preserved; free-response channels skip auto-threadtrue: auto-thread fires independently of the free-response settingno_thread_channelsWhy opt-in instead of changing the default?
Some existing users rely on free-response channels producing flat, non-threaded replies. Changing the default would break their UI expectations.
Example Config
Files Changed
gateway/platforms/discord.py— check new env var before decidingskip_threadgateway/config.py— bridgeconfig.yamlkey to env var