Skip to content

[Bug]: Telegram: message_thread_id sent in private chats causes 400 "message thread not found", silently drops messages #17242

@moneygalaxy

Description

@moneygalaxy

Summary

When sending messages to private chats (positive chatId), OpenClaw's Telegram integration passes message_thread_id derived from replyToId context. Telegram API rejects this with 400 Bad Request: message thread not found because private chats don't support forum topics. Messages are silently dropped.

Steps to reproduce

  1. Configure Telegram channel with a private chat (non-forum, positive chatId)
  2. Spawn a sub-agent via sessions_spawn
  3. Wait for sub-agent to complete and announce
  4. Observe 400 Bad Request: message thread not found in gateway.err.log
  5. User receives nothing in Telegram

Expected behavior

Private chats (positive chatId) should never include message_thread_id in the Telegram API call. Only group/supergroup chats (negative chatId) with forum topics enabled should use this parameter.

Actual behavior

sendMessageTelegram and sendMediaTelegram functions hardcode scope: "forum" when constructing the thread parameter. This causes:

  1. Sub-agent announce deliveries include a message_thread_id (from replyToId context)
  2. Telegram API rejects it for private chats (positive chatId)
  3. Message is silently lost — no retry, no fallback

OpenClaw version

2026.2.6-3

Operating system

macOS 26.2

Install method

No response

Logs, screenshots, and evidence

Impact and severity

Affects all message types sent to private (non-forum) chats:

• Sub-agent announce deliveries
• Proactive message tool sends
• Cron job deliveries
From gateway error logs over 4 days:

• Feb 11: 81 failures
• Feb 13: 20 failures
• Feb 14: 2 failures
• Feb 15: 8 failures

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions