Skip to content

feat(discord): auto-rename thread title from generated session title - #57813

Closed
NibbinNone wants to merge 1 commit into
NousResearch:mainfrom
NibbinNone:feat/discord-auto-title-thread-rename
Closed

feat(discord): auto-rename thread title from generated session title#57813
NibbinNone wants to merge 1 commit into
NousResearch:mainfrom
NibbinNone:feat/discord-auto-title-thread-rename

Conversation

@NibbinNone

@NibbinNone NibbinNone commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Wire Discord thread auto-rename to the existing auto-title mechanism (already used for Telegram topics).

When a Discord thread triggers the first exchange, Hermes generates a session title via the configured title_generation auxiliary model. This PR adds the missing title_callback so that title also renames the Discord thread — same pattern as Telegram topic rename.

Changes

plugins/platforms/discord/adapter.py

  • Add DiscordAdapter.rename_dm_topic() — calls thread.edit(name=...) via discord.py, capped at 100 chars

gateway/run.py

  • Add _schedule_discord_thread_title_rename() — mirrors _schedule_telegram_topic_title_rename(), threadsafe dispatch to asyncio loop
  • Wire Discord title_callback in maybe_auto_title flow when source.platform == Platform.DISCORD and source.thread_id is set

Verification

End-to-end tested on live Discord gateway: title generation → callback → thread rename confirmed working.

Add rename_dm_topic() to DiscordAdapter and wire it via
title_callback in the Gateway's maybe_auto_title flow,
mirroring the existing Telegram topic rename pattern.

Tested on live Discord gateway with auto-title generation
→ callback → thread.rename chain confirmed working.
@NibbinNone
NibbinNone force-pushed the feat/discord-auto-title-thread-rename branch from 8039519 to 803cf8b Compare July 3, 2026 15:55
@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter P3 Low — cosmetic, nice to have labels Jul 3, 2026
@teknium1

teknium1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixed via #60187 (salvage of #56792 by @rungmc357). Your title_callback wiring matched the Telegram pattern nicely, but #56792 additionally guarded against renaming user-created threads and human-renamed threads, which we needed. Thanks for the contribution!

@teknium1 teknium1 closed this Jul 7, 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 comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants