Skip to content

Telegram: inter-tool commentary clobbers tool progress in non-persist progress mode (diverges from other streaming channels) #90962

@anagnorisis2peripeteia

Description

@anagnorisis2peripeteia

Summary

In non-persist progress streaming mode with streaming.progress.commentary enabled, Telegram drops tool-progress lines that follow inter-tool commentary. The live progress draft renders the model's "Let me check X…" commentary but the subsequent 📖 Read … / tool lines never appear — so a multi-step turn shows commentary-only, with the tool activity clobbered.

This is Telegram-specific: every other streaming channel that renders a progress draft keeps tool progress and commentary coexisting.

Root cause

Telegram multiplexes tool progress + commentary + the answer into one editable "answer lane" message. Tool progress is rendered via pushStreamToolProgress (extensions/telegram/src/bot-message-dispatch.ts), which early-returns when answerLane.finalized is true. Inter-tool commentary arrives as assistant text (onPartialReplyingestDraftLaneSegments), which finalizes the lane; the next tool's pushStreamToolProgress then bails and the line is dropped.

It's an ordering artifact: the single-editable-draft model was built for tool-progress → answer (native sendMessageDraft, #83847; transient clear, b5c3379), and commentary-in-progress-drafts was layered on later (#81887, #41ee6b1dd6) without reconciling the tool↔commentary interleave.

How other streaming channels handle it

Channel Model Clobbers?
Discord tool + commentary feed a separate progress-draft compositor (pass-through, no answer-lane gate) No — coexist
Matrix both accumulate into one shared progress-line array (mergeChannelProgressDraftLine) No — coexist
MS Teams tool progress rendered in a separate streaming-card status region No — isolated
Slack array accumulation + a suppress-while-answering flag Mild (suppress, not hard-drop)
Telegram single multiplexed answer lane; commentary finalizes it → pushStreamToolProgress bails Yes
Mattermost single draft stream, last-write-wins Distinct race (separate issue)

Proposed fix (bring Telegram to parity)

  • Not "remove the finalized guard" — that spawns a new progress message per commentary→tool cycle. Instead, stop inter-tool (non-final) commentary from finalizing the answer lane in progress mode, so tool + commentary accumulate in one open draft. This mirrors the keep-lane-open behavior that the persist-mode work (feat(streaming): opt-in persistProgress mode for tool+commentary lines #89850) already proves renders both together.
  • Optional, on top: a shared progress-draft region model — commentary-region / tool-region with independent caps so neither evicts the other (opt-in, Telegram-enabled; reusable by Discord/Matrix).

Validation

  • Telegram dispatch regression: commentary → tool → commentary → tool keeps the 📖 lines in the draft.
  • Telegram Desktop capture showing tool + commentary interleaved in one live progress draft.

Relation to the commentary stack

Builds on #90883 (CLI commentary delivery/render) — the producer of the inter-tool commentary that exposes this. Telegram-only behavior change; shared-compositor capability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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