Skip to content

Feature: Handle forum_topic_created events to auto-discover new forum threads #3716

@HenkDz

Description

@HenkDz

Feature Request

Problem

Currently Hermes only discovers forum threads in two ways:

  1. DM topics — created at startup via dm_topics config (createForumTopic)
  2. Incoming messagesmessage_thread_id is captured from messages arriving in existing threads

If a user manually creates a new topic in a group (or another admin bot creates one), Hermes has no way to discover it. The Bot API has no getForumTopics method (open request: tdlib/telegram-bot-api#634), so there is no way to query the list of existing topics.

Proposed Solution

Handle the forum_topic_created update from Telegram and surface it to the agent.

When a new topic is created in a chat where Hermes is a member/admin:

  1. Gateway receives the forum_topic_created update
  2. Gateway notifies the agent with the details: chat_id, message_thread_id, name, icon_custom_emoji_id
  3. Agent can then update memory/config to register the new thread for future message routing

Implementation Notes

  • The forum_topic_created field is already present in Telegram Message objects when a topic is created
  • This should fire alongside the normal message pipeline — the Message update that carries forum_topic_created can be augmented with metadata
  • Optional: also handle forum_topic_edited (renamed) and forum_topic_closed/forum_topic_reopened for full lifecycle tracking

Use Case

User creates a new topic like "Deployments" or "Incident Response" in a Hermes-enabled group. Instead of manually sharing the thread ID with Hermes, the bot auto-discovers it and can route messages there.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions