Skip to content

feat: sync Discord thread names with session titles - #49980

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

feat: sync Discord thread names with session titles#49980
Fyko wants to merge 1 commit into
NousResearch:mainfrom
menelsystemsbot:feat/discord-thread-auto-title

Conversation

@Fyko

@Fyko Fyko commented Jun 21, 2026

Copy link
Copy Markdown

What does this PR do?

Syncs Hermes session titles to the platform-visible conversation name when the active platform supports it

This adds a generic BasePlatformAdapter.rename_conversation(...) capability, analogous to create_handoff_thread(...), so the gateway can request “rename the current visible conversation” without knowing whether that means a Discord thread, Telegram topic, or another platform-specific container

Discord implements this for thread channels, so both auto-generated session titles and manual /title ... updates rename the visible Discord thread instead of only updating the session database

Telegram topic title syncing is moved behind the same adapter capability while preserving the existing Telegram safety checks

Related Issue

N/A

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added optional BasePlatformAdapter.rename_conversation(...) capability in gateway/platforms/base.py
  • Updated the gateway title sync path in gateway/run.py to call the adapter capability instead of hardcoding platform-specific rename behavior
  • Updated /title ... handling in gateway/slash_commands.py so manual title changes also sync to supported visible conversation names
  • Implemented Discord conversation renaming in plugins/platforms/discord/adapter.py
    • Only renames thread channels
    • Sanitizes thread names to Discord’s 100-character limit
    • Uses Discord thread/channel edit(name=...)
  • Moved Telegram topic rename behavior into plugins/platforms/telegram/adapter.py
    • Skips root/general topics
    • Honors extra.disable_topic_auto_rename
    • Skips operator-declared dm_topics
    • Verifies the topic binding belongs to the current session before renaming
  • Added Discord title sync coverage in tests/gateway/test_discord_thread_title_rename.py
  • Updated Telegram topic title sync tests in tests/gateway/test_telegram_topic_mode.py
  • Updated /title command tests in tests/gateway/test_title_command.py

How to Test

  1. Run the targeted regression suite:
python -m pytest \
  tests/gateway/test_discord_thread_title_rename.py \
  tests/gateway/test_title_command.py \
  tests/agent/test_title_generator.py \
  tests/gateway/test_telegram_topic_mode.py \
  tests/gateway/test_discord_free_response.py \
  tests/e2e/test_discord_adapter.py \
  -q -o 'addopts='
  1. Confirm the suite passes:
139 passed
  1. In a Discord auto-thread session, send a message that triggers Hermes auto-title generation and confirm the Discord thread name updates to the generated session title

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A

Screenshots / Logs

Targeted regression suite:

139 passed

@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 platform/telegram Telegram bot adapter labels Jun 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #30559 (cross-platform update_topic_title base-adapter approach — closest mechanism analog, Telegram-only), #26477 (canonical open Discord thread-rename, supersedes #15757), #44958 (Discord bidirectional sync), #16408 (Telegram forum-topic sync). Tracking issues: #18430 (Discord), #16255 (Telegram).

This PR generalizes the base-adapter abstraction (rename_conversation(...), analogous to create_handoff_thread(...)) across BOTH Discord threads and Telegram topics, and routes both auto-title and manual /title through it — a broader cross-platform mechanism than the Discord-only or Telegram-only competitors. Reviewers picking a single canonical implementation for this long-standing cluster should compare this against #30559 and #26477.

@teknium1

teknium1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixed via #60187 (salvage of #56792 by @rungmc357). Your PR had the nicest architecture of the six — the generic rename_conversation() adapter capability is the right shape for this — but it also refactored the live Telegram rename path as part of a Discord feature, which was more blast radius than we wanted in one change.

If a third platform grows rename support (Slack threads, Matrix rooms), the capability-ABC approach you sketched is exactly what we'd reach for, and we'd welcome it as its own focused refactor at that point. 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 P3 Low — cosmetic, nice to have platform/discord Discord bot adapter platform/telegram Telegram bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants