Skip to content

Telegram: proactive sends fail with 'message thread not found' when Topics enabled in private chat (Premium) #14383

@1OAKDesign

Description

@1OAKDesign

Bug Description

When a Telegram Premium user enables Topics in a private bot chat, proactive sends (cron job announcements, etc.) fail with:

GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message thread not found)

Root Cause

In buildTelegramThreadParams, thread ID 1 (the general topic) is only skipped for scope: "forum":

if (normalized === TELEGRAM_GENERAL_TOPIC_ID && thread.scope === "forum") return;

Private chat topics were added in Bot API 9.3 (Dec 2025). When Topics is enabled in a private chat, incoming messages include message_thread_id: 1. OpenClaw stores this thread context with scope: "dm". On proactive sends, it passes message_thread_id: 1 back to the API — which Telegram rejects, because thread ID 1 (general topic) cannot be explicitly specified in sendMessage calls, regardless of chat type.

Expected Behavior

Proactive sends to private chats with Topics enabled should succeed by omitting message_thread_id when the thread ID is 1.

Suggested Fix

Skip thread ID 1 for all scopes, not just forum:

if (normalized === TELEGRAM_GENERAL_TOPIC_ID) return;

Workaround

Disable Topics in the bot's private chat settings.

Environment

  • OpenClaw 2026.2.6-3
  • Telegram Premium with Topics enabled in private bot chat
  • Bot API 9.3+

Metadata

Metadata

Assignees

No one assigned

    Labels

    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