fix(discord): accept metadata in media send methods#1109
Closed
insecurejezza wants to merge 1 commit intoNousResearch:mainfrom
Closed
fix(discord): accept metadata in media send methods#1109insecurejezza wants to merge 1 commit intoNousResearch:mainfrom
insecurejezza wants to merge 1 commit intoNousResearch:mainfrom
Conversation
586cd24 to
6978d56
Compare
teknium1
pushed a commit
that referenced
this pull request
Mar 13, 2026
…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>
Contributor
|
Merged via PR #1178. Media metadata fix included with authorship preserved. Thank you @insecurejezza! |
teknium1
added a commit
that referenced
this pull request
Mar 13, 2026
…adata fix (#1178) - 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 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.
Bug Description
Discord media delivery could fail even when tool output succeeded.
When Hermes returned a
MEDIA:attachment from tools liketext_to_speech, the base gateway send pipeline passed platform metadata into Discord media delivery calls. Onmain, Discord'ssend_voice,send_image_file, andsend_imagemethods did not accept ametadatakwarg.Root Cause
BasePlatformAdapterpassesmetadatathrough media send calls, but the Discord adapter's native media methods had stale signatures that omittedmetadata.That created a method-signature mismatch in the Discord attachment-delivery path.
Fix
metadata: Optional[Dict[str, Any]] = Noneto:DiscordAdapter.send_voiceDiscordAdapter.send_image_fileDiscordAdapter.send_imageHow to Verify
MEDIA:audio or image attachment in Discordpython -m pytest tests/gateway/test_discord_media_metadata.py tests/gateway/test_platform_base.py -qTest Plan
Risk Assessment
Low — this only aligns Discord method signatures with the existing base adapter call path. No behavior change beyond accepting the already-passed kwarg.
EOF; __hermes_rc=$?; printf 'HERMES_FENCE_a9f7b3'; exit $__hermes_rc