Skip to content

feat(telegram): Private Chat Topics with functional skill binding (#2598)#3163

Merged
teknium1 merged 3 commits into
mainfrom
hermes/hermes-6dfb41ea
Mar 26, 2026
Merged

feat(telegram): Private Chat Topics with functional skill binding (#2598)#3163
teknium1 merged 3 commits into
mainfrom
hermes/hermes-6dfb41ea

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvages PR #3005 by web3blind — Telegram Private Chat Topics support (Bot API 9.4, February 2026). Cherry-picked onto current main with functional skill binding added on top.

Closes #2598

What changed

From PR #3005 (web3blind)

  • DM topic creation via createForumTopic — Bot API 9.4 allows this in private chats
  • Config-driven topics — define topics per chat_id in platforms.telegram.extra.dm_topics
  • Thread ID persistencethread_id saved back to config.yaml after creation, preventing duplicates on restart
  • Session isolation — each topic gets its own session via existing build_session_key thread_id support
  • Hot-reload — topics added to config are discovered without gateway restart
  • 16 tests covering setup, persistence, cache, error handling

Added: Functional skill binding

The original PR had a cosmetic skill hint ([skill: name] in chat_topic text). This follow-up makes it actually work:

  • auto_skill field on MessageEvent — telegram adapter sets it from the topic's skill config
  • Gateway auto-loads the skill on new sessions — uses _load_skill_payload + _build_skill_message (same infrastructure as /skill-name slash commands)
  • Injected only on new sessions — subsequent messages see the skill in conversation history; no duplication
  • Clean chat_topic — topic name without the [skill: ...] suffix; skill flows through the dedicated field
  • 3 additional tests for auto_skill behavior

Configuration

platforms:
  telegram:
    extra:
      dm_topics:
      - chat_id: 123456789
        topics:
        - name: General
          icon_color: 7322096
          thread_id: 100  # auto-persisted after first creation
        - name: Accessibility Auditor
          icon_color: 9367192
          skill: accessibility-auditor  # auto-loaded on new sessions

Test results

  • 20 DM topics tests pass (17 original + 3 new)
  • 1453 gateway tests pass
  • 6203 full suite pass (1 pre-existing unrelated failure in anthropic error handling)

Cherry-picked from PR #3005 by web3blind.
Adds DM topic creation, persistence, and session isolation via Bot API 9.4.
Closes #2598
- Add auto_skill field to MessageEvent for topic-skill bindings
- Gateway auto-loads the bound skill on new sessions via _load_skill_payload
- Skill content is injected into the first message (same as /skill commands)
- Subsequent messages in the session see it in conversation history
- Clean chat_topic (no [skill: ...] suffix) — skill flows via auto_skill field
- Add 3 tests for _build_message_event auto_skill behavior
Documents DM topic configuration, skill binding, session isolation,
and how topic creation/persistence works. Updates the Recent Bot API
Features section to include Bot API 9.4.
@teknium1 teknium1 merged commit 36af1f3 into main Mar 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Telegram Private Chat Topics support for project-based conversations

1 participant