Bug
buildTelegramThreadParams() unconditionally returns undefined for scope: "dm", stripping message_thread_id from all DM sends. This causes replies to land in the wrong topic (or outside topics entirely) when a user has Telegram DM topics enabled.
Introduced in
Commit 19b8416a8 ("fix: unify telegram thread handling", Feb 2 2026) added the DM scope to buildTelegramThreadParams with a blanket return undefined:
// Never send thread_id for DMs (threads don't exist in private chats)
if (thread.scope === "dm") {
return undefined;
}
This was incorrect — Telegram Bot API 9.3 (Dec 31 2025) added Topics in private chats, which supports message_thread_id in DM sends.
Impact
Any bot with DM topics enabled (via @Botfather) will have replies misrouted. The existing withTelegramThreadFallback retry handles the opposite case (thread ID rejected by API), but cannot help when the thread ID is stripped before the request is even made.
Fix
PR #17952 — pass through positive thread IDs for DM scope, filter only invalid values (≤ 0).
Bug
buildTelegramThreadParams()unconditionally returnsundefinedforscope: "dm", strippingmessage_thread_idfrom all DM sends. This causes replies to land in the wrong topic (or outside topics entirely) when a user has Telegram DM topics enabled.Introduced in
Commit
19b8416a8("fix: unify telegram thread handling", Feb 2 2026) added the DM scope tobuildTelegramThreadParamswith a blanketreturn undefined:This was incorrect — Telegram Bot API 9.3 (Dec 31 2025) added Topics in private chats, which supports
message_thread_idin DM sends.Impact
Any bot with DM topics enabled (via @Botfather) will have replies misrouted. The existing
withTelegramThreadFallbackretry handles the opposite case (thread ID rejected by API), but cannot help when the thread ID is stripped before the request is even made.Fix
PR #17952 — pass through positive thread IDs for DM scope, filter only invalid values (≤ 0).