Skip to content

fix(discord): opt threaded free-response channels in - #62814

Open
voidberg-bot wants to merge 1 commit into
NousResearch:mainfrom
voidberg-bot:fix/discord-autothread-mention-free-channels
Open

fix(discord): opt threaded free-response channels in#62814
voidberg-bot wants to merge 1 commit into
NousResearch:mainfrom
voidberg-bot:fix/discord-autothread-mention-free-channels

Conversation

@voidberg-bot

@voidberg-bot voidberg-bot commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • preserve the existing inline default for Discord free_response_channels
  • add discord.force_thread_channels / DISCORD_FORCE_THREAD_CHANNELS as an explicit opt-in for mention-free intake channels that should still auto-thread
  • keep discord.no_thread_channels / DISCORD_NO_THREAD_CHANNELS as the stronger inline-reply opt-out
  • document the new setting and cover YAML/env precedence plus routing behavior in tests

Test

  • env -u DISCORD_ALLOWED_CHANNELS -u DISCORD_REQUIRE_MENTION -u DISCORD_FREE_RESPONSE_CHANNELS -u DISCORD_FORCE_THREAD_CHANNELS -u DISCORD_NO_THREAD_CHANNELS uv run --with pytest --with pytest-asyncio python -m pytest tests/gateway/test_discord_free_response.py tests/gateway/test_discord_channel_controls.py tests/e2e/test_discord_adapter.py -q -o addopts=
  • uv run --with ruff ruff check plugins/platforms/discord/adapter.py tests/gateway/test_discord_free_response.py tests/e2e/test_discord_adapter.py tests/conftest.py tools/environments/local.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #33110 — same core mechanism (drop is_free_channel from skip_thread so free-response channels auto-thread, keeping DISCORD_NO_THREAD_CHANNELS as the opt-out). #33110 is the earliest still-open PR with that unconditional-decouple approach; this PR is a cleaner 2-file version of the same fix. This is a heavily saturated cluster (closed predecessors #12304/#26074/#31852). Note the competing alternative approach in #49726/#54285, which instead add an opt-in DISCORD_FORCE_THREAD_CHANNELS list rather than unconditionally decoupling — maintainer picks the approach.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused routing tests. The current-main premise is real: plugins/platforms/discord/adapter.py:6223 makes every free-response channel skip auto-threading.

Problems

  • The proposed replacement changes the established default for every existing free-response channel. Current docs explicitly describe free-response as inline to keep a lightweight chat surface (website/docs/user-guide/messaging/discord.md:377) and state that free-response bypasses auto-threading (:385). This PR does not update that contract or provide an explicit migration/selection mechanism.
  • This is not admission-only in operational effect: when auto-thread creation fails, the current thread-first path drops the request after sending an error (plugins/platforms/discord/adapter.py:6244-6263), whereas free-response channels currently remain inline.

Suggested changes

  • Preserve the documented inline default and implement a config-backed opt-in for selected free-response channels if maintainers choose the dual-workflow design; retain no_thread_channels as the stronger opt-out.
  • Include documentation and configuration/precedence tests with the selected API.

This is an automated hermes-sweeper review.

Comment thread plugins/platforms/discord/adapter.py Outdated
#
# Important: free-response controls admission only. It must not also
# imply no-thread, because mention-free bot channels commonly still want
# one thread per new top-level topic. Use DISCORD_NO_THREAD_CHANNELS for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unconditionally changes the existing free-response contract, which current docs intentionally describe as inline to keep a lightweight chat surface (website/docs/user-guide/messaging/discord.md:377,385). Please preserve that default unless maintainers select the unconditional behavior; a config-backed opt-in would support threaded intake channels without changing every existing free-response channel.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state 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 11, 2026
@voidberg-bot
voidberg-bot force-pushed the fix/discord-autothread-mention-free-channels branch from 83405ce to d64c7c2 Compare July 12, 2026 06:01
@voidberg-bot voidberg-bot changed the title fix(discord): auto-thread free-response channels fix(discord): opt threaded free-response channels in Jul 12, 2026
@voidberg-bot

Copy link
Copy Markdown
Author

Thanks — addressed in the latest push.

Changes from the original version:

  • Preserves the documented free-response inline default.
  • Adds discord.force_thread_channels / DISCORD_FORCE_THREAD_CHANNELS as the explicit opt-in for mention-free intake channels that should still auto-thread.
  • Keeps discord.no_thread_channels as the stronger inline-reply opt-out when both are configured.
  • Adds docs plus routing/config tests for default inline behavior, force-thread opt-in, YAML bridging, and no-thread precedence.

Local verification:

  • 89 passed for the focused Discord gateway/e2e tests.
  • ruff check passed on the touched Python files.

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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/discord Discord bot 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 sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants