-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
All cron job deliveries fail in Telegram DMs with:
GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message thread not found)
Environment
- OpenClaw: 2026.2.6-3
- Channel: Telegram (DM, not group/forum)
- Cron: isolated session + delivery.announce
Root Cause
Related to #10926. Commit 19b8416a8 introduced a regression where message_thread_id=1 is sent to Telegram API for DM chats. The fix in buildTelegramThreadParams() only skips thread_id=1 when scope === "forum", but DMs have scope === "dm".
What I tried (hotfixes, none worked)
- Patched
buildTelegramThreadParams()in all 3 dist files (extensionAPI.js, reply-B_4pVbIX.js, loader-n6BPnYom.js) to skip thread_id=1 unconditionally - Patched
subagent-announce.tsto skip threadId="1" in callGateway params - Tried
delivery.bestEffort: true - Tried
sessionTarget: main+systemEvent
None resolved the issue because the thread_id appears to be injected at the gateway routing layer, after these functions.
Reproduction
{
"schedule": {"kind": "at", "at": "<2min-from-now>"},
"payload": {"kind": "agentTurn", "message": "test", "model": "haiku"},
"sessionTarget": "isolated",
"delivery": {"mode": "announce", "channel": "telegram", "to": "<dm-chat-id>"}
}Expected
Message delivered to Telegram DM.
Actual
Infinite retries, each failing with thread_not_found. Sub-agent runs 20+ times burning tokens.
Impact
- All cron notifications to Telegram DMs are broken
- Each failed cron spawns 20+ retry sessions (token waste)
- Only workaround: sub-agent uses message tool directly with chatId (unreliable, causes spam)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working