fix(telegram): keep tool progress after non-final commentary#90997
fix(telegram): keep tool progress after non-final commentary#90997wsyjh8 wants to merge 1 commit into
Conversation
Root cause: non-final inter-tool commentary suppressed the progress draft via prepareAnswerLaneForText. In non-persist progress streaming mode (with streaming.progress.commentary enabled) commentary arrives as assistant partial text (onPartialReply -> ingestDraftLaneSegments), whose answer-lane rotation in rotateAnswerLaneAfterToolProgress called suppressProgressDraftState. The next tool's pushStreamToolProgress was then dropped on the compositor's progressSuppressed guard, so the tool-progress lines after commentary vanished. Fix: in progress mode, route non-final answer-lane partial text into the shared progress draft's commentary lane (progressDraft.pushCommentaryProgress, keyed per assistant message) so commentary and tool progress accumulate in one open draft instead of tearing the lane down. This reuses the same commentary lane the onItemEvent preamble path already uses. The pushStreamToolProgress finalized / final-delivery guard and the final-answer cleanup path are left unchanged, and no new config is added. Adds a dispatch regression covering the commentary -> tool -> commentary -> tool interleave that asserts every tool-progress line stays in the draft. This is the Telegram consumer-side fix, independent of openclaw#90883 (the commentary producer); it should land first so enabling commentary + non-persist progress does not immediately regress. Fixes openclaw#90962 Signed-off-by: Jason Yao <wsyjh8@gmail.com>
|
Codex review: needs real behavior proof before merge. Reviewed June 6, 2026, 3:45 PM ET / 19:45 UTC. Summary PR surface: Source +17, Tests +48. Total +65 across 2 files. Reproducibility: yes. for source-level reproduction, but not live reproduction here. Current main suppresses the progress compositor after answer-lane partial text, and the compositor then drops subsequent tool progress on the progressSuppressed guard. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land only after a redacted Telegram Desktop or equivalent live Telegram probe confirms commentary and subsequent tool progress remain together in the progress draft, with the focused regression test kept. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction, but not live reproduction here. Current main suppresses the progress compositor after answer-lane partial text, and the compositor then drops subsequent tool progress on the progressSuppressed guard. Is this the best way to solve the issue? Yes, this looks like the narrow owner-boundary fix: it keeps final-delivery guards intact and reuses the existing progress commentary compositor. The missing piece is live Telegram proof, not a different code shape. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f5a7f613ee4d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +17, Tests +48. Total +65 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Correction after a deeper producer-side traceA closer look at where this fix's inputs actually come from shows the PR's stated 1. Corrected trigger
2. Gating gap (retraction) — confirmed by a dispatcher runThe fix is gated on 3. Scope questionBefore I finish this, could you confirm #90962's intended scope:
Note I haven't confirmed live that a shipped provider actually emits untagged inter-tool text Going by its title, #71589 ("suppress tool-use assistant text", open) may point the 4. Next stepOnce you confirm direction I'll adjust accordingly (drop/keep the gate per (a)/(b)) and add |
Summary
In non-persist
progressstreaming mode withstreaming.progress.commentaryenabled, Telegram drops the tool-progress lines that follow inter-tool
commentary: the live progress draft shows the model's "Let me check X…"
commentary, but the subsequent
📖 Read …/ tool lines never appear. Everyother streaming channel keeps tool progress and commentary coexisting.
Root cause
Non-final inter-tool commentary suppressed the progress draft via
prepareAnswerLaneForText. Inprogressmode commentary arrives as assistantpartial text (
onPartialReply→ingestDraftLaneSegments); for an answer-lanesegment that path calls
prepareAnswerLaneForText→rotateAnswerLaneAfterToolProgress, whichclear()s the draft and callssuppressProgressDraftState(). The next tool'spushStreamToolProgressis thendropped inside the compositor on the
progressSuppressedguard, so thetool-progress lines after commentary vanish.
(For precision: the lane is not "finalized" —
rotateAnswerLaneAfterToolProgressresets
finalizedtofalseand suppresses the compositor; the drop is theprogressSuppressedguard, not thefinalizedguard.)Fix
In
progressmode, when commentary is enabled, route non-final answer-lanepartial text into the shared progress draft's commentary lane
(
progressDraft.pushCommentaryProgress, keyed per assistant message) socommentary and tool progress accumulate together in one open draft instead of
tearing the lane down. This reuses the same commentary lane the
onItemEventpreamble path already uses.
Deliberately unchanged:
pushStreamToolProgressfinalized/ final-delivery guard — it is correctfor real final delivery and is not relaxed.
message on completion.
progressDraft.commentaryProgressEnabled.Trigger conditions / scope
Reproduces only when all three hold within one turn:
streaming.progress.commentaryenabled (default: off)progressstreaming modeDefault config is unaffected. The diverting branch is gated on commentary
being enabled; with commentary off, the answer-lane path is unchanged from
main(
prepareAnswerLaneForText), so users on defaults see no behavior change.Testing
bot-message-dispatch.test.tsdrives thecommentary → tool → commentary → toolinterleave and asserts everytool-progress line (and the commentary) stays in the draft. It fails on
main(the second tool line is dropped) and passes with this change.
extensions/telegram/src/bot-message-dispatch.test.ts,src/plugin-sdk/channel-streaming.test.ts,extensions/discord/src/monitor/message-handler.process.test.ts; plustsgo:extensions(+:test),lint:extensions, andoxfmt --checkclean.under Windows (
/tmppath resolution); it reproduces on cleanmainand isout of scope for this PR.
that's what surfaces real inter-tool commentary to reproduce this end to end.
Relation to #90883
This is the Telegram consumer-side fix and is independent of #90883 (the
commentary producer). It should land first: once #90883 merges, every
user with commentary + non-persist progress would immediately hit this clobber,
so shipping this guard ahead of it prevents the regression.
Fixes #90962