feat(discord): /thread command, auto_thread config, and media metadata fix#1178
Merged
feat(discord): /thread command, auto_thread config, and media metadata fix#1178
Conversation
…adata fix - Add /thread slash command that creates a Discord thread and starts a new Hermes session in it. The starter message (if provided) becomes the first user input in the new session. - Add discord.auto_thread config option (DISCORD_AUTO_THREAD env var): when enabled, every message in a text channel automatically creates a thread, allowing parallel isolated sessions. - Fix Discord media method signatures to accept metadata kwarg (send_voice, send_image_file, send_image) — prevents TypeError when the base adapter passes platform metadata. - Fix test mock isolation: add app_commands and ForumChannel to discord mocks so tests pass in full-suite runs. Based on PRs #866 and #1109 by insecurejezza, modified per review: removed /channel command (unsafe), added auto_thread feature, made /thread dispatch new sessions. Co-authored-by: insecurejezza <insecurejezza@users.noreply.github.com>
This was referenced Mar 13, 2026
10 tasks
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.
Summary
Based on PRs #866 and #1109 by @insecurejezza, modified per review.
What's included
/threadslash command — Creates a Discord thread and starts a new Hermes session in it. If a starter message is provided, it becomes the first user input in the new session (each thread = isolated session).discord.auto_threadconfig — When enabled, every message that pings the bot in a text channel automatically creates a thread for the response. This allows parallel conversations without manual thread creation.Also configurable via
DISCORD_AUTO_THREAD=trueenv var.Discord media metadata fix (from PR fix(discord): accept metadata in media send methods #1109) — Adds missing
metadatakwarg tosend_voice,send_image_file, andsend_imagemethods, preventingTypeErrorwhen the base adapter passes platform metadata.What was removed from original PRs
/channelcommand — Removed as unsafe (any user interacting with the bot could create server channels without permission checks).Other fixes
test_discord_free_response.py's discord mock now includesapp_commandsandForumChannel, preventing cross-test failures when the full gateway suite runs.Test Plan
source .venv/bin/activate python -m pytest tests/gateway/test_discord_slash_commands.py tests/gateway/test_discord_media_metadata.py tests/gateway/test_discord_free_response.py -n0 -qFull suite: 3454 passed, 6 pre-existing failures (unrelated to Discord).
Related
Co-authored-by: insecurejezza insecurejezza@users.noreply.github.com