Skip to content

fix(gateway): rename Telegram topic from /title, not only auto-titles - #49245

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/title-telegram-topic-rename
Jun 19, 2026
Merged

fix(gateway): rename Telegram topic from /title, not only auto-titles#49245
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/title-telegram-topic-rename

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

/title <name> now renames the visible Telegram forum topic, not just the session title in the database.

Salvage of #49172 by @hakanpak, cherry-picked onto current main with authorship preserved.

Root cause

Auto-generated session titles already rename the Telegram topic via the auto-title title_callback_schedule_telegram_topic_title_rename. But _handle_title_command only called set_session_title, so a user who ran /title to override the auto-assigned topic name saw the DB title change while the topic name stayed put — no way to rename the topic after Hermes auto-named it.

Changes

  • gateway/slash_commands.py: on a successful /title set, also call the existing _schedule_telegram_topic_title_rename(source, session_id, sanitized). The helper already no-ops off Telegram topic lanes and when disable_topic_auto_rename is set, so other platforms and the show-title (no-arg) path are unaffected.
  • tests/gateway/test_title_command.py: /title <name> schedules the topic rename with the sanitized title; the show-title path does not.

Validation

Before After
/title <name> renames Telegram topic no (DB only) yes
Show-title (/title no-arg) triggers rename no no (unchanged)
Non-Telegram platforms affected no no (helper no-ops)
tests/gateway/test_title_command.py 14 16 passed

Picks the cleanest of the duplicate cluster (#35678, #46644, #21111, #14462) — reuses the canonical helper rather than reimplementing topic-rename machinery, on current base, with test coverage for both the rename and no-rename-on-show paths.

Closes #49172

…tles

Auto-generated session titles already rename the Telegram forum topic via
the title_callback path, but the /title command only wrote the session
title to the database. On a Telegram topic lane the visible topic kept its
auto-assigned name, so a user who ran /title to override it saw no change.

Propagate the user-chosen title to the topic by calling the existing
_schedule_telegram_topic_title_rename helper on a successful /title set. It
already no-ops off Telegram topic lanes and when auto-rename is disabled.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 19, 2026
@kshitijk4poor
kshitijk4poor enabled auto-merge (rebase) June 19, 2026 20:23
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #14462 — this salvage implements the same /title to Telegram-topic-rename fix as the existing cluster (canonical OPEN #14462; #49172 was already triaged as a duplicate of #14462). It wires _handle_title_command to the _schedule_telegram_topic_title_rename helper, which is not present in gateway/slash_commands.py on main (it lands with the cluster PRs), so this PR no-ops standalone — same reason #49172 was dup'd.

Salvage of #49172. Related: #21111 (open same-mechanism), #46644 (broader groups+/title scope). The canonical fix to land remains #14462.

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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants