feat(telegram): Private Chat Topics support (Bot API 9.4)#3005
Closed
web3blind wants to merge 1 commit into
Closed
feat(telegram): Private Chat Topics support (Bot API 9.4)#3005web3blind wants to merge 1 commit into
web3blind wants to merge 1 commit into
Conversation
Implements Telegram Private Chat Topics for 1-on-1 DM conversations, allowing bots to create and manage isolated topic threads within a single private chat. Based on Bot API 9.4 (Feb 2026). Changes: - _create_dm_topic(): create forum topics in DM chats - _setup_dm_topics(): load/create topics from config at startup - _persist_dm_topic_thread_id(): save thread_ids to config.yaml - _get_dm_topic_info(): topic lookup with hot-reload from config — topics added externally are picked up without gateway restart - _reload_dm_topics_from_config(): live config reload for new topics - _cache_dm_topic_from_message(): dynamic topic discovery - _build_message_event(): DM topic name resolution + skill context No gateway restart needed when adding topics externally. Closes NousResearch#2598
1c7dd5b to
5506139
Compare
teknium1
added a commit
that referenced
this pull request
Mar 26, 2026
) Salvages PR #3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes #2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
Contributor
|
Merged via PR #3163. Your DM Private Chat Topics implementation was cherry-picked onto current main with authorship preserved. Added on top: functional skill binding (auto_skill field on MessageEvent, gateway auto-loads the bound skill on new sessions) and a full docs section for the Telegram messaging guide. Thanks for the solid contribution! |
outsourc-e
pushed a commit
to outsourc-e/hermes-agent
that referenced
this pull request
Mar 26, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
Cherry-picked from PR NousResearch#3005 by web3blind. Adds DM topic creation, persistence, and session isolation via Bot API 9.4. Closes NousResearch#2598
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
CumulusService
pushed a commit
to Cumulus-Service-GmbH/hermes-agent
that referenced
this pull request
May 30, 2026
Cherry-picked from PR NousResearch#3005 by web3blind. Adds DM topic creation, persistence, and session isolation via Bot API 9.4. Closes NousResearch#2598
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…usResearch#2598) Salvages PR NousResearch#3005 by web3blind. Cherry-picked onto current main with functional skill binding and docs added. - DM topic creation via createForumTopic (Bot API 9.4, Feb 2026) - Config-driven topics with thread_id persistence across restarts - Session isolation via existing build_session_key thread_id support - auto_skill field on MessageEvent for topic-skill bindings - Gateway auto-loads bound skill on new sessions (same as /skill commands) - Docs: full Private Chat Topics section in Telegram messaging guide - 20 tests (17 original + 3 for auto_skill) Closes NousResearch#2598 Co-authored-by: web3blind <web3blind@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Telegram Private Chat Topics support (Bot API 9.4, February 2026), allowing bots to create and manage isolated topic threads within 1-on-1 private chats.
Closes #2598
What changed
gateway/platforms/telegram.py_create_dm_topic()— Creates a forum topic in a DM chat viacreateForumTopic(Bot API 9.4). Handles duplicate topic errors gracefully._setup_dm_topics()— Runs at gateway startup. Loads topicthread_ids from config if already persisted (preventing duplicate creation on restart). Only calls the API for topics that don't have athread_idyet._persist_dm_topic_thread_id()— After creating a new topic, saves itsthread_idback toconfig.yaml. This is the key fix for the duplication bug — without persistence, every gateway restart would attempt to re-create all topics._get_dm_topic_info()— Looks up topic config (name, skill binding) bythread_idfrom the runtime cache._cache_dm_topic_from_message()— Discovers topic mappings from incomingforum_topic_createdservice messages._build_message_event()— Updated to resolve DM topic names and inject skill context hints (e.g.,"Accessibility Auditor [skill: accessibility-auditor]") intochat_topicfor session routing.tests/gateway/test_dm_topics.py16 tests covering all new methods — loading from config, creating via API, persistence, cache behavior, error handling, and edge cases.
Configuration
New config section under
platforms.telegram.extra:How it works
config.yaml_setup_dm_topics()checks each topic:thread_idexists in config → loads into memory cache (no API call)thread_id→ callscreateForumTopic, caches result, persiststhread_idto configmessage_thread_idare matched to the cached topicsbuild_session_keyalready supportsthread_id)skillbinding automatically inject context for the agentSession isolation
The existing session routing (
gateway/session.py) already supportsthread_idin the session key format:So each DM topic automatically gets its own independent conversation history, memory flush, and context.