Skip to content

[Bug]: Telegram cron jobs fail with "message thread not found" error for private chats #14742

@TK7684

Description

@TK7684

Summary

Cron jobs with Telegram delivery fail with GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message
thread not found) when sending to private Telegram chats, even though the delivery mode is set to "dm" (direct
message) and no threadId is specified.

Steps to reproduce

  1. Configure OpenClaw with Telegram bot and add a private chat ID to the allowlist
  2. Create a cron job with "sessionTarget": "isolated" and Telegram delivery:
    {
    "id": "test-job",
    "name": "Test",
    "enabled": true,
    "schedule": {"expr": "*/5 * * * *", "kind": "cron"},
    "sessionTarget": "isolated",
    "payload": {
    "kind": "agentTurn",
    "message": "Send a test message",
    "model": "any-model"
    },
    "delivery": {
    "mode": "dm",
    "channel": "telegram",
    "to": "<private_chat_id>"
    }
    }
  3. Start OpenClaw gateway: systemctl --user start openclaw-gateway
  4. Wait for cron job to execute
  5. Check .openclaw/cron/runs/.jsonl for the result

Expected behavior

The cron job should successfully send a Telegram direct message to the specified private chat ID. Since:

  • The delivery mode is "dm" (direct message)
  • The target is a private chat (confirmed via Telegram API getChat returns "type": "private")
  • No threadId is specified in the delivery configuration
  • Private chats don't support threads/topics

Expected: Message is delivered successfully to the private chat.

Actual behavior

The cron job executes successfully (generates correct output), but Telegram delivery fails with:

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

The error persists even after:

  • Setting "mode": "dm" in delivery config
  • Removing all threadId/messageThreadId from delivery config
  • Restarting OpenClaw gateway

Verification: Direct Telegram API call works fine:
curl -X POST "https://api.telegram.org/bot/sendMessage"
-d "chat_id=<private_chat_id>"
-d "text=Test"

Returns: {"ok": true, ...}

This confirms the bot token and chat ID are valid. The issue is OpenClaw is incorrectly injecting a message_thread_id
parameter into the Telegram API call.

Environment

  • Clawdbot version: 2026.2.6-3
  • OS: Linux (Ubuntu/Debian on WSL2)
  • Install method: npm global (npm install -g openclaw)
  • Node version: v22.12.0
  • Affected file: apps/node-v22.12.0-linux-x64/lib/node_modules/openclaw/dist/extensionAPI.js

Logs or screenshots

Cron Run Log (.openclaw/cron/runs/.jsonl):

{
"ts": 1770909364444,
"jobId": "0a373a69-6fd5-4923-81ac-48fe5ca53bcd",
"action": "finished",
"status": "error",
"error": "GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message thread not found)",
"summary": ""
}

Gateway Log (/tmp/openclaw/openclaw-2026-02-12.log):

2026-02-12T15:21:23.536Z [telegram/api] telegram message failed: Call to 'sendMessage' failed! (400: Bad Request:
message thread not found)

Telegram Bot API Verification:

Check chat type

curl "https://api.telegram.org/bot/getChat?chat_id=<private_chat_id>"

Response: {"ok":true,"result":{"id":,"type":"private",...}}

Direct send works

curl -X POST "https://api.telegram.org/bot/sendMessage"
-d "chat_id=<private_chat_id>"
-d "text=Test"

Response: {"ok":true,"result":{"message_id":279,...}}

Cron Job Configuration:

{
"delivery": {
"mode": "dm",
"channel": "telegram",
"to": "<private_chat_id>"
}
}

Note: Bot token and exact chat ID redacted for security.

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