feat(discord)!: scope free_response_channels to mention gating only - #82354
Open
zucram wants to merge 2 commits into
Open
feat(discord)!: scope free_response_channels to mention gating only#82354zucram wants to merge 2 commits into
zucram wants to merge 2 commits into
Conversation
zucram
marked this pull request as ready for review
August 9, 2026 07:59
Reframes the change in 210e764, which was mislabelled `fix`. Nothing was broken: 93fe4b3 folded `is_free_channel` into `skip_thread` deliberately, and 73d0b08 (NousResearch#12728) then documented it precisely because users were reporting it as a bug. This commit proposes changing that intent, not correcting an error. The argument for changing it: `free_response_channels` currently decides two unrelated things. It answers "may the bot reply without an @mention?" and, as a side effect, "where does the reply go?". Those are orthogonal policies, and conflating them means an operator who wants mention-free chat cannot also have per-conversation threading — there is no way to express that combination. It also makes the threading rule non-local: you cannot tell whether a channel threads by reading `auto_thread` and `no_thread_channels`, which is where a reader would look. After this change, threading is governed only by `auto_thread` plus `no_thread_channels`, and `no_thread_channels` is the single escape hatch. Note this is not a new capability for unmentioned messages — with `require_mention: false` and `auto_thread: true`, ordinary channel messages already auto-threaded. `free_response_channels` was the one place that silently opted out. BREAKING CHANGE: channels in `discord.free_response_channels` / `DISCORD_FREE_RESPONSE_CHANNELS` now auto-thread instead of replying inline. To restore the previous behavior for a channel, add its ID to `discord.no_thread_channels` / `DISCORD_NO_THREAD_CHANNELS`. Voice-linked text channels and reply-type messages still skip threading as before. Also in this commit, both missing from 210e764: - Docs. The shipped docs still asserted the old behavior in six places across `discord.md`, `configuration.md`, `environment-variables.md` and `cli-config.yaml.example`, so the branch contradicted its own documentation. Updated, with a migration note under `discord.free_response_channels`. The zh-Hans translations carried the same claims and are updated to match. `DISCORD_HISTORY_BACKFILL` is left alone: its free-response exemption is about the mention gap, not threading, and is unaffected. - The regression test added by 93fe4b3, test_discord_free_response_channel_skips_auto_thread, still asserted the old behavior and failed on this branch. Replaced with the inverse assertion plus coverage for the documented migration path (free-response + no_thread_channels replies inline). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 this is
A proposal to change a deliberate design decision, not a bugfix. The branch was originally titled
fix(discord), which misrepresented it — apologies for the noise. Retitled and rewritten.free_response_channelscurrently skips auto-threading. That is intentional: 93fe4b3 foldedis_free_channelintoskip_threadon purpose, and #12728 then documented it explicitly, noting the behavior "was intentional but never documented, causing user confusion." This PR argues the intent should change. If you disagree, closing it is a perfectly reasonable outcome and no rework is wasted.Why change it
free_response_channelsdecides two unrelated things:@mention? (mention gating)Consequences of coupling them:
auto_threadandno_thread_channelsare where a reader looks to answer "does this channel thread?", and both can say yes while a third setting silently overrides them.no_thread_channelsalready exists and is documented as the threading opt-out.After this change, threading is governed only by
auto_thread+no_thread_channels, andno_thread_channelsis the single escape hatch.To be precise about the scope: this is not a new capability for unmentioned messages. With
require_mention: falseandauto_thread: true, ordinary channel messages already auto-threaded.free_response_channelswas the one place that opted out.Unchanged: voice-linked text channels and reply-type messages still skip threading, and
DISCORD_HISTORY_BACKFILL's free-response exemption is untouched — that one is about the mention gap, not routing.Breaking change
Channels in
discord.free_response_channels/DISCORD_FREE_RESPONSE_CHANNELSnow auto-thread instead of replying inline. Anyone relying on the documented behavior will see a thread per conversation where they previously saw inline replies.Migration: add the same channel IDs to
discord.no_thread_channels/DISCORD_NO_THREAD_CHANNELS.The commit is marked
feat(discord)!:with aBREAKING CHANGE:trailer. If you would rather this land behind an opt-in flag than as a default change, say so and I will rework it that way.Changes
plugins/platforms/discord/adapter.py— dropor is_free_channelfrom theskip_threadgate; update the comment to describe the new rule.website/docs/user-guide/messaging/discord.md,configuration.md,reference/environment-variables.mdandcli-config.yaml.example, including a migration note underdiscord.free_response_channels. The zh-Hans translations asserted the same behavior and are updated to match.test_discord_free_response.py::test_discord_free_response_channel_skips_auto_thread(added by 93fe4b3) asserted the old behavior and failed on the previous revision of this branch. Replaced with the inverse assertion, plus new coverage for the migration path (free-response +no_thread_channels→ inline).Validated
Run on Linux, Python 3.11.15, discord.py 2.7.1, in an isolated venv.
scripts/run_tests.sh tests/gateway/test_discord_channel_controls.py tests/gateway/test_discord_free_response.py -q→ 2 files, 29 tests passed, 0 failedtests/gateway -k discord, per-file isolation → 275 passed, 2 skipped, no failures attributable to this change.ruff check .(the blocking lint job) → All checks passedascii-guard lint --exclude-code-blocks docs(docs-site-checks) → 401 files, 0 errorsnpm run build:fast(Docusaurus, en) → success; the only broken links reported are the pre-existing/docs/llms.txtand/docs/llms-full.txt, unrelated to these pages.Not run: the full suite, Windows/macOS, and a live Discord server. This touches one boolean in a routing gate, so the risk is concentrated in the config semantics rather than the platform, but a maintainer sanity-check against a real server before merging would be sensible.
🤖 Generated with Claude Code