Repository navigation
Description
Problem
When the model produces text → calls tools → produces more text → calls more tools → delivers final text, all intermediate text blocks share the same streaming preview message and are overwritten by subsequent blocks. Only the final text is visible to the user. Meaningful intermediate content (summaries, findings, explanations) is silently lost.
This is a regression from PR #32890.
Steps to reproduce
- Ask the agent to browse multiple websites in one turn
- Agent writes "Let me check site A..." → streams to preview
- Agent calls browser tools
- Agent writes "Site A shows X. Now checking site B..." → overwrites preview
- Agent calls more tools
- Agent writes "Done. Sites A and B show X and Y." → overwrites preview again, finalizes
- User sees only: "Let me check site A..." and "Done." — the intermediate summary is lost
Any turn where the model produces multiple meaningful text blocks separated by tool calls will silently lose text.
Root cause
PR #32890 removed the archive + forceNewMessage logic from onAssistantMessageStart in bot-message-dispatch.ts to prevent inter-tool narration from leaking into chat as separate messages. But it removed ALL interleaved delivery — not just the transient narration.
The stream now reuses a single preview across all text blocks in a turn. The streamText function in lane-delivery-text-deliverer.ts updates that preview in place for non-final blocks (isFinal=false) but never commits them as real messages before the final block overwrites them. The onAssistantMessageStart handler only calls rotateLaneForNewMessage when the lane is already finalized — which never happens for intermediate blocks.
Relevant code
extensions/telegram/src/bot-message-dispatch.ts→onAssistantMessageStarthandler — only rotates whenanswerLane.finalizedis trueextensions/telegram/src/lane-delivery-text-deliverer.ts→streamText()— updates preview in place for non-final blocks, only commits on isFinal=trueextensions/telegram/src/draft-stream.ts→onSupersededPreviewcallback — deletes superseded previews when forceNewMessage() is called
Prior art
- Text between tool calls leaks to messaging channels #25592 "Text between tool calls leaks to messaging channels" — the original issue
- PR fix(telegram): reuse preview message across tool-use rounds to prevent inter-tool text leak #32890 "fix(telegram): reuse preview message across tool-use rounds to prevent inter-tool text leak" — the fix that caused this regression
- PR feat(telegram): opt-in interleaved progress lane #87072 "feat(telegram): opt-in interleaved progress lane" — partly addresses this but is opt-in and progress-focused
Expected behavior
Text blocks delivered with info.kind === "block" (non-final) should either be finalized as real messages before a new text block starts, or be cumulatively preserved so the user sees all text the model produced.
Environment
- OpenClaw: 2026.5.26 (10ad3aa) — also reproducible on main as of 2026-05-27
- Channel: Telegram (streaming mode: partial)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 27, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 27, 2026, 11:09 AM ET / 15:09 UTC.
Summary
Keep open: current main still has the reported Telegram preview behavior, and the fix direction needs maintainer product judgment because preserving inter-tool text can conflict with the existing suppression work for transient tool narration.
Reproducibility: yes. for source-level reproduction: current Telegram lane delivery tests and code show a non-final block preview update followed by a final update on the same message. I did not establish a live Telegram run in this read-only review.
Next step
A fix is likely needed, but maintainers should first decide the durable-block contract so a repair does not undo the suppression behavior tracked in related inter-tool narration work.
Review details
Best possible solution:
Define which inter-tool text is durable user-facing
blockcontent, then preserve only that content in Telegram without reopening transient tool/progress narration leaks.Do we have a high-confidence way to reproduce the issue?
Yes for source-level reproduction: current Telegram lane delivery tests and code show a non-final block preview update followed by a final update on the same message. I did not establish a live Telegram run in this read-only review.
Is this the best way to solve the issue?
Unclear: preserving all interleaved text would not be the safest fix by itself because prior work intentionally suppresses transient tool narration. The maintainable path needs a narrower durable-block contract before code changes.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 91590132f68a.
Label changes
Label changes:
P1: The issue describes current Telegram channel message loss for multi-tool turns in the latest release and current main.impact:message-loss: Non-final text blocks can be overwritten by later preview/final text, leaving user-visible intermediate content absent from chat history.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.clawsweeper:needs-product-decision: Current issue advisory state selects this label.Label justifications:
P1: The issue describes current Telegram channel message loss for multi-tool turns in the latest release and current main.impact:message-loss: Non-final text blocks can be overwritten by later preview/final text, leaving user-visible intermediate content absent from chat history.Evidence reviewed
Acceptance criteria:
What I checked:
createLaneTextDeliverersetslane.finalized = false, callsstream.update(firstChunk), flushes for non-final blocks, and returnspreview-updated; final text later edits the same stream and only then marks the lane finalized. (extensions/telegram/src/lane-delivery-text-deliverer.ts:323, 91590132f68a)onAssistantMessageStartwhenanswerLane.finalizedis already true, so an intermediate block that was only preview-updated stays on the same preview message. (extensions/telegram/src/bot-message-dispatch.ts:1939, 91590132f68a)infoKind: "block"textworking, then final textdone, expects two updates on the same draft stream, and expects no normalsendPayloadcall for the block. (extensions/telegram/src/lane-delivery.test.ts:122, 91590132f68a)partialpreview streaming as a single preview replaced with latest text, and Telegram runtime docs say final text edits the active preview in place. Public docs:docs/concepts/streaming.md. (docs/concepts/streaming.md:125, 91590132f68a)preview-updatedlane behavior and rotate-only-when-finalized Telegram boundary; current main only changes imports and inbound-event plumbing in these files relative to the release. (extensions/telegram/src/lane-delivery-text-deliverer.ts:325, 10ad3aa16068)blocktext.Likely related people:
extensions/telegram/src/lane-delivery-text-deliverer.ts,extensions/telegram/src/bot-message-dispatch.ts,extensions/telegram/src/lane-delivery.test.ts)extensions/telegram/src/bot-message-dispatch.ts,extensions/telegram/src/bot-message-dispatch.test.ts)extensions/telegramand introduced the current extension file layout in available history. (role: refactor author; confidence: low; commits: e5bca0832fbd; files:extensions/telegram/src/bot-message-dispatch.ts,extensions/telegram/src/lane-delivery-text-deliverer.ts,extensions/telegram/src/lane-delivery.test.ts)extensions/telegram/src/bot-message-dispatch.ts,extensions/telegram/src/bot-message-dispatch.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.WarrenJones commentedon May 27, 2026
AbdelftahZowail commentedon May 27, 2026
To illustrate the difference between useful content and narration that should stay suppressed, here's a concrete example from a real interaction:
Real interaction: multi-site browsing
User: "Can you browse a few sites and tell me what you find?"
Agent internal output:
browser_navigate("https://httpbin.org/headers")browser_navigate("https://news.ycombinator.com")browser_extract_content(...)browser_navigate("https://httpbin.org/html")browser_get_html("body")What the user actually saw on Telegram:
All three intermediate content blocks (steps 3, 6, 9) were silently lost because they shared the same preview message and each one overwrote the previous. The user never saw the findings they asked for.
The UX tradeoff
What SHOULD be suppressed (narration): plain tool-play commentary that adds no value outside the agent loop — e.g. "Now I will navigate to HN", "Let me extract the content", "I should check the status code". These were the target of PR #32890 and suppressing them is correct.
What currently gets suppressed but SHOULD be delivered: any intermediate text that communicates findings, results, or context to the user — e.g. "HN shows X story with Y points", "Site B is down, trying alternative", "Found 3 matches so far, continuing search". These are real content that the user explicitly asked for.
The challenge: these two categories look identical to the streaming pipeline. Both are
info.kind === "block"text chunks between tool calls. The current code treats them both the same — stream to preview, never commit, let the final block overwrite everything.One possible direction: if a non-final text block exceeds a certain length or contains substantive content patterns, it could be worth committing as a real message rather than living only in the transient preview.
anagnorisis2peripeteia commentedon May 27, 2026
interested in how we can collaborate here.
It's easier imo to define the reply block inbetween tool blocks as "reasoning" that belongs in the reasoning lane in telegram and that's why in 87072 I aim to recreate what one might see in a cli like claude code or codex with all the whirrs and dings that make you feel like it's running and doing something
rollingshmily commentedon May 31, 2026
Same issue here — OpenClaw 2026.5.28 on Telegram.
Every turn that involves tool calls + intermediate text blocks, the intermediate content gets silently overwritten. User sees nothing between tool calls, only the final block survives.
This is a severe regression that makes basic Telegram chat almost unusable. I've had to disable streaming entirely (
streaming.mode: off) as a workaround, which is not ideal.A lot of us use OpenClaw primarily through Telegram — would really appreciate prioritizing this fix. The root cause is clear (PR #32890 removed archive + forceNewMessage logic), should be relatively straightforward to patch.
Thanks!
AbdelftahZowail commentedon Jun 7, 2026
I don't really understand how OSS contribution works here on GitHub but I think they're working on it as well speak so hopefully it'll be out soon
fix(cli): bridge inter-tool commentary events to channel progress
fix(cli): bridge inter-tool commentary events to channel progress
fix(cli): bridge inter-tool commentary events to channel progress