Skip to content

fix: add Discord threaded free-response channels - #52802

Open
itsflownium wants to merge 1 commit into
NousResearch:mainfrom
itsflownium:fix/discord-free-response-threads-52766
Open

fix: add Discord threaded free-response channels#52802
itsflownium wants to merge 1 commit into
NousResearch:mainfrom
itsflownium:fix/discord-free-response-threads-52766

Conversation

@itsflownium

@itsflownium itsflownium commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary\n- Add discord.free_response_thread_channels / DISCORD_FREE_RESPONSE_THREAD_CHANNELS for mention-free Discord channels that still use automatic threading.\n- Keep existing free_response_channels behavior inline by skipping thread creation only for the original list.\n- Apply the new setting to the early human-mention gate, while retaining mention filtering in all other channels.\n- Add Discord adapter regression tests and document the setting.\n\nValidation\n- 80 focused Discord tests\n- Ruff on the changed adapter and tests\n\nFixes #52766

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter labels Jun 26, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved

Looks Good

  • Clean extraction of _discord_channel_id_set() as a reusable static method
  • New _discord_free_response_thread_channels() follows the same pattern
  • Proper config + env var fallback chain
  • Well-documented with clear docstrings
  • Feature is additive — no breaking changes to existing behavior

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for targeting a real Discord routing gap: current main still makes is_free_channel imply skip_thread at plugins/platforms/discord/adapter.py:6223.

Problems

  • The new setting is only consumed in _handle_message. The earlier on_message gate admits human-mentioned, bot-unmentioned messages only when _discord_free_response_channels() matches (plugins/platforms/discord/adapter.py:1201-1204), so the proposed threaded-free setting would not consistently be mention-free.
  • The adapter hunk is stale: gh pr diff 52802 | git apply --check --verbose fails at the former helper block. Current routing uses _discord_channel_keys() (plugins/platforms/discord/adapter.py:6170), which the port should preserve.

Suggested changes

  • Rebase the logic conceptually onto the current channel-key flow: use the new set for mention gating, but retain threading unless the channel is in the existing inline-free or no-thread sets.
  • Extend the early delivery gate and add a regression case for a threaded-free channel containing a human mention without a Hermes mention.

Automated hermes-sweeper review.

@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 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery 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 type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants