Skip to content

Telegram forum topics: streaming think-block causes reply to drop message_thread_id #89352

Description

@pmika

Bug

When reasoning/thinking is enabled and <think> blocks are live-streamed as separate Telegram messages, the subsequent standard text reply is sent via a raw sendMessage call that does not inherit message_thread_id from the original inbound context.

Effect

The reply lands outside the forum topic (or is silently dropped) instead of being delivered into the correct thread. The agent turn completes successfully — the issue is purely in delivery routing.

Affected code path

Streaming code path only. The bug does not affect non-streaming replies or replies in non-forum (flat) chats.

Steps to reproduce

  1. Use a Telegram group with forum topics enabled.
  2. Enable reasoning/thinking for the agent session.
  3. Send a message to a topic thread.
  4. Observe: the <think> block arrives in the correct topic, but the final reply lands outside the topic (missing message_thread_id).

Expected behavior

The final reply should carry the same message_thread_id as the inbound message, regardless of whether <think> blocks were streamed earlier in the same turn.

Notes

Reported by user in session agent:main:telegram:group:-1003620988369:topic:14041. The <think> streaming messages arrived correctly; only the final text reply dropped the thread context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions