Skip to content

feat(gateway/discord): sync thread names with session titles - #15757

Closed
TabooHarmony wants to merge 1 commit into
NousResearch:mainfrom
TabooHarmony:sync-discord-thread-titles
Closed

feat(gateway/discord): sync thread names with session titles#15757
TabooHarmony wants to merge 1 commit into
NousResearch:mainfrom
TabooHarmony:sync-discord-thread-titles

Conversation

@TabooHarmony

Copy link
Copy Markdown

Auto-generated session titles (after the first exchange) and user-set titles via /title now propagate to Discord thread names.

Problem: Session titles are generated and stored in the local SQLite database, visible in /sessions list and the web dashboard. Discord thread names, however, are set once at thread creation and never updated. This creates a disconnect between the two.

Changes:

  • DiscordAdapter.rename_thread() - edits thread names via discord.py
  • After maybe_auto_title(), fire a lightweight async task that polls the session DB for up to 15s and renames the thread when the title appears
  • Also sync immediately when /title is used

This bridges the gap between Hermes session titles and Discord thread names.

Auto-generated session titles (after the first exchange) and user-set
titles via /title now propagate to Discord thread names.

- Add DiscordAdapter.rename_thread() to edit thread names via discord.py
- After maybe_auto_title(), fire a lightweight async task that polls
  the session DB for up to 15s and renames the thread when the title
  appears
- Also sync immediately when /title is used

This bridges the gap between Hermes session titles (visible in
/sessions list and the web dashboard) and Discord thread names,
which were previously set once at thread creation and never updated.
@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 Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #13915 (opt-in smart auto-retitling for Discord threads) and #3009 — overlapping feature area. This PR takes the always-on approach vs #13915's opt-in config toggle.

@TabooHarmony

Copy link
Copy Markdown
Author

Thanks for the context, wasn't aware of #13915.
The always-on approach here was intentional for minimal invasiveness (no new config keys, no user-facing toggles).
Happy to pivot this to an opt-in model or close it in favor of #13915 if that's the direction the maintainers prefer.

@teojs

teojs commented May 19, 2026

Copy link
Copy Markdown

Very useful feature, looking forward to the developers merging it soon

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing the disconnect between session titles and Discord threads. Current main has since landed the automatic-title half of this behavior via 0d9ed9214: gateway/run.py:19021-19026 passes a callback after auto-title generation, and gateway/run.py:13527-13572 limits retitles to Hermes-created auto-threads.

Problems

  • The PR's generic Discord thread_id checks would rename pre-existing or human-renamed threads. Current main intentionally records auto-thread provenance and requires the original placeholder name before editing (plugins/platforms/discord/adapter.py:5403-5405, 5431-5437).
  • The PR's code-point truncation is not safe for Discord's UTF-16 title limit; current main uses UTF-16-aware sanitization (plugins/platforms/discord/adapter.py:5417-5421, follow-up 1deeaf71a).
  • The PR adds no regression tests for the async rename behavior.

Suggested changes

  • Target the remaining explicit /title gap in gateway/slash_commands.py:3487-3504, and reuse the current guarded rename path rather than polling the session DB.
  • Add coverage for explicit Discord /title plus preservation of human-renamed and pre-existing threads.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added 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 12, 2026
@alt-glitch alt-glitch added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages and removed sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 12, 2026
@teknium1 teknium1 added the area/sessions Session lifecycle, resume, persistence, history label Jul 19, 2026
@alt-glitch alt-glitch added the comp/plugins Plugin system and bundled plugins label Jul 19, 2026
@alt-glitch alt-glitch added the needs-decision Awaiting maintainer decision before any implementation label Jul 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #26477 rather than a duplicate: this branch polls the session DB while #26477 uses a different title-sync path. The adapter was migrated to plugins/platforms/discord/adapter.py on main, and the branch also bundles unrelated reply_to delivery changes; please rebase/split before review.

@alt-glitch alt-glitch removed the comp/plugins Plugin system and bundled plugins label Jul 19, 2026
@TabooHarmony TabooHarmony closed this by deleting the head repository Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/gateway Gateway runner, session dispatch, delivery needs-decision Awaiting maintainer decision before any implementation 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-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