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 <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed June 21, 2026, 2:57 PM ET / 18:57 UTC. Summary PR surface: Source +17, Tests +48. Total +65 across 2 files. Reproducibility: yes. for the source path: current main can suppress the progress compositor when answer-lane partial text follows tool progress, and the suppressed compositor then drops later tool progress. I did not run a fresh live Telegram reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 findings
Review detailsBest possible solution: Land a maintainer-approved Telegram progress-mode fix for the intended partial-text scope, with regression coverage and redacted live Telegram proof showing later tool progress remains visible. Do we have a high-confidence way to reproduce the issue? Yes for the source path: current main can suppress the progress compositor when answer-lane partial text follows tool progress, and the suppressed compositor then drops later tool progress. I did not run a fresh live Telegram reproduction in this read-only review. Is this the best way to solve the issue? No as-is: the patch is a plausible commentary-enabled fix, but it is too narrow if the approved scope includes the default commentary-off interleave or suppressing untagged tool-use assistant text instead. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edd1d3319cce. Label changesLabel 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 |
|
Closing as superseded by #98907, which landed on Decision: close in favor of the broader root-cause fix. Why: this PR patched the commentary-vs-tool-progress loss narrowly and had drifted into conflict with Thanks @wsyjh8 for identifying and attacking this — the report and PR helped pin the canonical issue (#90962). If you see any remaining gap on a build containing dae86e6, please open a fresh issue with a capture. |
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