Skip to content

Cron delivery to private DM topics broken after PR #22410 — send_message_tool.py missing three-mode routing #22773

@afelipeps

Description

@afelipeps

Summary

PR #22410 (commit b3239572f) fixed DM topic routing for live messages in gateway/platforms/telegram.py::TelegramAdapter.send() after Bot API 10.0 broke sendMessage(message_thread_id=N) for private chats with topics. However, the cron delivery path (tools/send_message_tool.py::_send_telegram) was not updated with the same three-mode routing logic.

Replication

  1. Create DM topics in a private Telegram chat (Bot API 9.3+)
  2. Configure a cron with deliver: telegram:<chat_id>:<thread_id>
  3. Cron executes → message lands in General topic instead of the specified thread

Root Cause

tools/send_message_tool.py::_send_telegram sends with bare message_thread_id parameter, which Bot API 10.0 (2026-05-08) now rejects for private chats with topics. The fix requires message_thread_id + reply_to_message_id (anchor message) together, as implemented in the gateway adapter.

Expected Behavior

Cron delivery should use the same three-mode routing as TelegramAdapter.send():

  1. Forum/supergroup → message_thread_id
  2. Bot API DM topics → direct_messages_topic_id
  3. Hermes-created private DM topic lanesmessage_thread_id + reply_to_message_id (anchor) together

Workaround (temporary)

All 12 crons moved to deliver to General (telegram:<chat_id> without thread_id) with emoji prefixes for visual filtering.

Related

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/cronCron scheduler and job managementplatform/telegramTelegram bot adaptertype/bugSomething isn't working

    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