Skip to content

fix(telegram): drop message_thread_id=1 for DM chats#12758

Open
yukihamada wants to merge 1 commit intoopenclaw:mainfrom
yukihamada:fix/telegram-dm-thread-id
Open

fix(telegram): drop message_thread_id=1 for DM chats#12758
yukihamada wants to merge 1 commit intoopenclaw:mainfrom
yukihamada:fix/telegram-dm-thread-id

Conversation

@yukihamada
Copy link

Summary

Fixes #12625 — cron job announcements fail in Telegram DMs with "message thread not found" error.

  • buildTelegramThreadParams() now drops message_thread_id=1 for DM chats (not just forum groups)
  • Changed scope check from === "forum" to !== "none" so both forum and DM scopes correctly omit the thread parameter
  • Updated test expectations and added edge case coverage for scope: "none"

Root Cause

Commit 19b8416a8 introduced a regression where message_thread_id=1 is sent for DM chats. Telegram's API rejects this for DMs with "message thread not found". The fix in buildTelegramThreadParams only stripped thread_id=1 for scope === "forum", missing the "dm" case.

Test plan

  • pnpm test src/telegram/bot/helpers.test.ts — 25/25 tests pass
  • pnpm build — type check passes
  • pnpm check — no lint/format issues in changed files

🤖 Generated with Claude Code

Telegram rejects sendMessage with message_thread_id=1 in DM chats
("message thread not found"). The condition in buildTelegramThreadParams
only dropped thread_id=1 for forum scope, but DMs need the same treatment.

Change scope check from === "forum" to !== "none" so both forum and DM
scopes correctly omit the thread parameter.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cron delivery.announce fails in Telegram DMs: message_thread_id=1 regression

1 participant

Comments