Skip to content

feat(discord): /thread command, auto_thread config, and media metadata fix#1178

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-31d07af4
Mar 13, 2026
Merged

feat(discord): /thread command, auto_thread config, and media metadata fix#1178
teknium1 merged 1 commit intomainfrom
hermes/hermes-31d07af4

Conversation

@teknium1
Copy link
Contributor

Summary

Based on PRs #866 and #1109 by @insecurejezza, modified per review.

What's included

  1. /thread slash 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).

  2. discord.auto_thread config — 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.

    # config.yaml
    discord:
      auto_thread: true

    Also configurable via DISCORD_AUTO_THREAD=true env var.

  3. Discord media metadata fix (from PR fix(discord): accept metadata in media send methods #1109) — Adds missing metadata kwarg to send_voice, send_image_file, and send_image methods, preventing TypeError when the base adapter passes platform metadata.

What was removed from original PRs

  • /channel command — Removed as unsafe (any user interacting with the bot could create server channels without permission checks).

Other fixes

  • Fixed test mock isolation: test_discord_free_response.py's discord mock now includes app_commands and ForumChannel, 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 -q

Full suite: 3454 passed, 6 pre-existing failures (unrelated to Discord).

Related

Co-authored-by: insecurejezza insecurejezza@users.noreply.github.com

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants