hermes - 💡(How to fix) Fix [Bug]: Telegram topic-enabled DM shows typing but never delivers response [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Telegram topic-enabled DMs can accept/process a user message and show the bot as typing, but the assistant response never appears in the same DM topic.

This is distinct from plain Telegram DMs and group/forum topics, which can still work. The failure is specifically visible in a Telegram private chat that has been converted to/uses Direct Messages topics.

Error Message

  • User sends a message inside a topic-converted Telegram DM.
  • Hermes appears to receive/process it: Telegram shows the bot typing.
  • No assistant response is delivered into that DM topic.
  • Group chats still respond normally.
  • Local logs show repeated warnings of the shape:

Root Cause

Likely root cause

Fix Action

Fixed

Code Example

[Telegram] Thread <dm-topic-id> not found, retrying without message_thread_id
RAW_BUFFERClick to expand / collapse

Summary

Telegram topic-enabled DMs can accept/process a user message and show the bot as typing, but the assistant response never appears in the same DM topic.

This is distinct from plain Telegram DMs and group/forum topics, which can still work. The failure is specifically visible in a Telegram private chat that has been converted to/uses Direct Messages topics.

Observed behavior

  • User sends a message inside a topic-converted Telegram DM.
  • Hermes appears to receive/process it: Telegram shows the bot typing.
  • No assistant response is delivered into that DM topic.
  • Group chats still respond normally.
  • Local logs show repeated warnings of the shape:
[Telegram] Thread <dm-topic-id> not found, retrying without message_thread_id

The fallback can cause replies to miss the intended DM topic/root silently from the user's perspective.

Expected behavior

For Telegram topic-enabled DMs, Hermes should send responses back into the same DM topic where the user message arrived.

In particular:

  • Topic-enabled private/direct chat topics should not be sent with message_thread_id if Telegram expects direct_messages_topic_id.
  • Group/forum topics should continue using message_thread_id.
  • Plain DMs should suppress thread identifiers to avoid Message thread not found.
  • If delivery fails, logs should make clear whether the retry delivered outside the topic or failed entirely.

Likely root cause

Telegram Bot API / python-telegram-bot now distinguish Direct Messages topic routing from group/forum topic routing. Hermes appears to store the private DM topic id in the session source/thread metadata and then send it as message_thread_id, which is only valid for forum/group topics. Telegram rejects that with Message thread not found / Thread not found.

There is already an open PR that appears to target this exact root cause:

  • #21941 — fix(telegram): send Direct Messages topics with direct_messages_topic_id

Related older/nearby issues/PRs:

  • #3206 — spurious Telegram DM message_thread_id causing Message thread not found
  • #10371 — normalize DM threads and retry control sends
  • #2598 / #3005 — private chat topics support

Reproduction sketch

  1. Enable Telegram private-chat / Direct Messages topics for the bot.
  2. Create or use a stable DM topic in the private bot chat.
  3. Send the bot a message in that DM topic.
  4. Observe that Telegram shows typing / processing, but no response appears in the same topic.
  5. Check gateway logs for Thread <id> not found, retrying without message_thread_id.

Acceptance criteria

  • A user message in a Telegram DM topic receives the response in that same DM topic.
  • The adapter routes private Direct Messages topics with direct_messages_topic_id.
  • The adapter routes group/forum topics with message_thread_id.
  • Plain private DMs do not send either invalid topic field.
  • Regression coverage includes the current gateway metadata shape for topic-enabled DMs.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

For Telegram topic-enabled DMs, Hermes should send responses back into the same DM topic where the user message arrived.

In particular:

  • Topic-enabled private/direct chat topics should not be sent with message_thread_id if Telegram expects direct_messages_topic_id.
  • Group/forum topics should continue using message_thread_id.
  • Plain DMs should suppress thread identifiers to avoid Message thread not found.
  • If delivery fails, logs should make clear whether the retry delivered outside the topic or failed entirely.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Telegram topic-enabled DM shows typing but never delivers response [1 pull requests]