Skip to content

fix(telegram): rename runtime-discovered DM topics - #58430

Open
tianma-if wants to merge 1 commit into
NousResearch:mainfrom
tianma-if:codex/telegram-voice-topic-title
Open

fix(telegram): rename runtime-discovered DM topics#58430
tianma-if wants to merge 1 commit into
NousResearch:mainfrom
tianma-if:codex/telegram-voice-topic-title

Conversation

@tianma-if

Copy link
Copy Markdown
Contributor

Summary

  • distinguish operator-declared Telegram DM topics from runtime-discovered topic-name cache entries before auto-rename
  • allow newly created topics such as Telegram's default "New Thread" to be renamed from the generated session title
  • add regression coverage that preserves the existing operator-declared topic guard

Fixes #57341

Tests

  • .venv/bin/python -m pytest tests/gateway/test_telegram_topic_mode.py -q
  • .venv/bin/python -m ruff check gateway/run.py tests/gateway/test_telegram_topic_mode.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages P3 Low — cosmetic, nice to have labels Jul 4, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the runtime-cache versus operator-config distinction; the current-head code confirms that this is a real bug.

Problems

  • The PR is conflicting, and its historical self.adapters.get(source.platform) lookup must not be carried forward. Current main resolves this path with self._adapter_for_source(source) at gateway/run.py:13906; that resolver preserves secondary-profile adapter isolation in gateway/authz_mixin.py:41-70.

Suggested changes

  • Salvage the new _dm_topics_config membership check after current main's source-aware adapter resolution, rather than replacing it with the PR's older lookup.
  • Keep the added runtime-cache regression coverage; plugins/platforms/telegram/adapter.py:8522-8548 confirms why the prior dict-based guard incorrectly classifies cached topics as configured ones.

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 15, 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/telegram Telegram bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram topic remains unnamed ('New Thread') when first message is a voice/audio message

3 participants