feat(telegram): per-topic skill binding and auto-discovery for group forums#5489
Open
willy-scr wants to merge 2 commits into
Open
feat(telegram): per-topic skill binding and auto-discovery for group forums#5489willy-scr wants to merge 2 commits into
willy-scr wants to merge 2 commits into
Conversation
0ff85e4 to
2ca1920
Compare
…forums Adds native support for per-topic skill binding in Telegram group forum chats, with automatic topic discovery via lifecycle events. Skill binding: - Load group_topics config from platforms.telegram.extra - _get_group_topic_info() resolves skill by chat_id + thread_id - _reload_group_topics_from_config() hot-reloads without restart - _build_message_event() passes auto_skill for topic-routed messages Auto-discovery (lifecycle events): - forum_topic_created → auto-persist new topic to config.yaml - forum_topic_edited → update topic name in config - forum_topic_closed/reopened → track open/closed state - _persist_group_topic() registers new topics (skips duplicates) - _persist_group_topic_edit() handles renames and state changes Mirrors the existing dm_topics pattern. Fully backward compatible. Closes NousResearch#4622 Closes NousResearch#3716
…ponse The _run_agent method references 'event' which is not in scope when sending the first response before processing a queued follow-up message. This causes NameError and the response fails to deliver to the correct chat/topic. Fix: use 'message' parameter which is already in scope and contains the metadata needed for proper routing.
2ca1920 to
a551f99
Compare
Collaborator
|
Related to #5488 (companion fix for forum topic service message handler registration). |
2 similar comments
Collaborator
|
Related to #5488 (companion fix for forum topic service message handler registration). |
Collaborator
|
Related to #5488 (companion fix for forum topic service message handler registration). |
This was referenced May 1, 2026
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
Adds native support for per-topic skill binding and automatic topic discovery in Telegram group forum (supergroup) chats. Closes #4622, Closes #3716
What Changed
gateway/platforms/telegram.py(+66 lines):Skill Binding
__init__) — Readsgroup_topicsfromplatforms.telegram.extraconfig_get_group_topic_info()— Looks up topic config by chat_id + thread_id_reload_group_topics_from_config()— Hot-reloads group_topics from config.yaml without restart_build_message_event()branch — Resolves group topic skill binding and passes asauto_skillAuto-Discovery (Lifecycle Events)
_persist_group_topic()— Auto-registers new topics to config.yaml_persist_group_topic_edit()— Handles renames and close/reopen state_build_message_event()lifecycle handlers:forum_topic_created— auto-persist new topic with name + thread_id + iconforum_topic_edited— update topic name in configforum_topic_closed— mark topic as closedforum_topic_reopened— mark topic as reopenedgateway/run.py(+1/-1):messageinstead ofeventfor first-response sendKey Features
dm_topicspattern for consistencyTesting