Skip to content

fix: sync Telegram topic titles with /title - #14462

Closed
a5r0n wants to merge 3 commits into
NousResearch:mainfrom
a5r0n:fix/telegram-topic-title-sync
Closed

fix: sync Telegram topic titles with /title#14462
a5r0n wants to merge 3 commits into
NousResearch:mainfrom
a5r0n:fix/telegram-topic-title-sync

Conversation

@a5r0n

@a5r0n a5r0n commented Apr 23, 2026

Copy link
Copy Markdown

Summary

  • rename Telegram topic threads when /title is used inside a Telegram topic
  • support Telegram's separate general-topic rename API and cache topic-title changes
  • add gateway and adapter tests covering thread renames and topic service updates

Test Plan

  • source venv/bin/activate && pytest -q tests/gateway/test_title_command.py tests/gateway/test_dm_topics.py

@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Overlaps significantly with #9921 (auto-rename forum topics on session title change) — maintainers should decide which to merge.

@a5r0n

a5r0n commented Apr 23, 2026

Copy link
Copy Markdown
Author

Update: I expanded tests to improve coverage around the refactored native title-sync flow.

Added coverage for:

  • title-generator error and persistence-failure paths
  • post-delivery callback composition and generation-filter behavior
  • Telegram topic-title guard/early-return paths and cached topic-name propagation
  • gateway title-sync helper fallbacks and auto-title scheduling helpers
  • set_session_title_if_missing empty-title rejection

Validation run:

source venv/bin/activate && pytest -q tests/agent/test_title_generator.py tests/gateway/test_dm_topics.py tests/gateway/test_run_progress_topics.py tests/gateway/test_title_command.py tests/test_hermes_state.py

Result: 269 passed

Coverage check on the refactored area:

source venv/bin/activate && coverage run -m pytest -o addopts="" -q tests/gateway/test_title_command.py tests/agent/test_title_generator.py tests/gateway/test_dm_topics.py tests/gateway/test_run_progress_topics.py tests/test_hermes_state.py && coverage report -m agent/title_generator.py gateway/platforms/base.py gateway/platforms/telegram.py gateway/run.py hermes_state.py

Changed-line coverage now looks strong for the new code:

  • agent/title_generator.py: 100%
  • gateway/platforms/base.py: 98.2%
  • gateway/platforms/telegram.py: 99.0%
  • gateway/run.py: 92.7%
  • hermes_state.py: 100%

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing the /title → Telegram topic-rename portion of this as a duplicate of #49172, salvaged into #49245 (merging now) — it reuses the existing _schedule_telegram_topic_title_rename helper rather than reimplementing the rename machinery, with tests for both the rename and no-rename-on-show paths.

Your PR also carries broader scope (title-sync beyond the manual /title command). If that wider piece is still wanted, a focused follow-up PR scoped to just that extra behavior would be welcome — the core /title gap is now covered on main.

Thanks for the contribution; credited in the merged PR.

#49245

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 P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants