Skip to content

feat(telegram): opt-in interleaved progress lane#87072

Merged
obviyus merged 2 commits into
openclaw:mainfrom
anagnorisis2peripeteia:feat/telegram-interleaved-progress
Jun 3, 2026
Merged

feat(telegram): opt-in interleaved progress lane#87072
obviyus merged 2 commits into
openclaw:mainfrom
anagnorisis2peripeteia:feat/telegram-interleaved-progress

Conversation

@anagnorisis2peripeteia

@anagnorisis2peripeteia anagnorisis2peripeteia commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an opt-in Telegram renderer that projects reasoning text and structured runtime events into a single durable live message on the reasoning lane, matching CLI ergonomics without changing execution semantics.

Gated on three conditions: toolProgressEnabled && interleavedProgress === true && hasReasoningLane — inherits every existing group/DM/visibility gate.

What it does

When channels.telegram.streaming.preview.interleavedProgress is enabled:

  • Reasoning text streams into the interleaved message with a "Thinking" header
  • Tool starts append a sanitized line (tool name only, never raw args by default)
  • Item/plan/approval/command/patch events append title-only summary lines
  • A rolling timer (20s cadence) shows elapsed time + a wall-clock stamp while running, so a stalled lane is visible at a glance; cleared on completion
  • The model's reply is delivered once as the polished answer message — it is not mixed into the Thinking lane
  • Long turns spill into continuation messages instead of freezing at Telegram's length cap
  • Falls back to the existing pushStreamToolProgress lane when the flag is off

Key design choices

  • Projection-only — no changes to prompts, model routing, tool execution, or auth
  • No raw data — tool lines show name only; interleavedToolArgs is a separate opt-in for sanitized args
  • No new event contract — consumes existing onReasoningStream, onToolStart, onItemEvent, onPlanUpdate, onApprovalEvent, onCommandOutput, onPatchSummary callbacks unchanged
  • Reasoning + tools only; reply stays out — the lane renders reasoning (onReasoningStream) and tool/event lines; the model's reply prose is not folded into it. Folding reply text in and stripping it back out at delivery proved unreliable — the model often drafts an answer, runs tools, then re-emits a revised one, leaving several answer-like copies of which only the last matches the polished final text. So the reply is delivered exactly once, as the answer. For the interactive backend the proxy restores real thinking on its own onReasoningStream, so reasoning is unaffected; a defensive final-answer strip remains for redacted-thinking backends that bridge assistant text into the reasoning lane. Tagged payloads (<think>reason</think>answer) keep only the in-tag reasoning, so answer prose after </think> never lands in the lane.
  • Single reasoning stream, delta-append — appended as monotonic deltas (a cumulative snapshot contributes only its new suffix), so re-delivery never duplicates and the lane reads chronologically reasoning → tool → reasoning → …. The overlap fold is guarded: it folds a full-tail re-send (and full-increment duplicates) but never a short/mid-word coincidence, so a fresh fragment never loses its leading character.
  • Continuation on overflow — as the durable message approaches Telegram's 4096-char cap the lane spills into a fresh continuation message (carrying recent context) instead of letting the draft stream stop editing and freeze the lane
  • Rate-limit-aware cadence — the rolling "still running" timer ticks every 20s (not every few seconds) so N concurrently-streaming Thinking messages stay under Telegram's per-chat edit rate and don't draw 429s (a 429 drops the edit and stalls the lane); the line carries a wall-clock stamp so a genuine stall is obvious
  • No empty Thinking — a turn that reaches final delivery with no reasoning/tool/status content (and no running timer) renders nothing, so the lane never emits a bare "Thinking" header
  • Plain-text transcript — reasoning tag markers (<think> etc.) are unwrapped so the lane shows the model's prose, never raw tags

Prerequisite

The renderer otherwise consumes only existing callbacks and is default-off, so it depends on no unmerged work. (On the standard claude-cli backend, CLI-native reasoning text additionally benefits from #85381's thinking_delta; without it the lane simply shows tool/event lines. The interactive backend restores thinking via its proxy, so reasoning appears regardless. Either way the default tool-progress lane is unaffected — this is not a hard dependency.)

Changed files

  • extensions/telegram/src/interleaved-progress.ts — pure render helpers (gate, sanitize, header-strip, message render with length cap + no-content guard + wall-clock timer stamp, delta-append with cumulative-snapshot handling + guarded overlap fold, continuation-spill computation, defensive final-answer strip, status-line append, timer-interval constant)
  • extensions/telegram/src/bot-message-dispatch.ts — wire callbacks through the renderer with fallback; single reasoning-stream delta append (reply prose kept out of the lane); spill into a continuation message before the length cap; suppress an empty Thinking flush at final delivery; 20s rolling-timer cadence; reasoning-tag unwrapping; clear rolling timer in finally
  • extensions/telegram/src/reasoning-lane-coordinator.tsstripReasoningTagsForInterleaved (extract only in-<think> reasoning, dropping answer prose after </think>, preserving code regions)
  • src/config/types.telegram.ts + src/config/zod-schema.providers-core.ts — opt-in flag schema
  • Config surface docs + bundled channel metadata regeneration

Test plan

  • Unit tests: disabled-by-default, explicit opt-out, tool-progress-off, no-reasoning-lane, header dedup, rolling-timer lifecycle + wall-clock stamp, whitespace-collapse + length cap, delta-append no-duplication across a long cumulative stream, guarded overlap fold (no 1-char coincidence drop; full-tail re-send still folds), continuation-spill (repeated spills stay under the cap; giant-line force-advance; oversized-body tail-cap), no-content render guard, tagged-reasoning split (answer after </think> dropped; streaming/code cases), defensive final-answer strip
  • Live Telegram proof at current head (below)

Verification

Local checks at the current head:

pnpm tsgo:extensions                                                 # typecheck — clean
pnpm exec oxlint extensions/telegram/src/interleaved-progress.ts \
                 extensions/telegram/src/bot-message-dispatch.ts \
                 extensions/telegram/src/reasoning-lane-coordinator.ts   # lint — clean
npx vitest run extensions/telegram/src/interleaved-progress.test.ts \
               extensions/telegram/src/reasoning-lane-coordinator.test.ts   # all green

Real behavior proof

Behavior addressed: Opt-in Telegram interleaved progress renders reasoning plus tool/progress events in one durable Thinking message, without duplicating the final answer or freezing at Telegram message limits.

Real environment tested: Real OpenClaw Telegram gateway against Telegram, default-off feature explicitly enabled, two concurrent Telegram threads in one chat.

Exact steps or command run after this patch: Rebuilt and ran the gateway from the PR head, enabled channels.telegram.streaming.preview.interleavedProgress, sent concurrent Telegram prompts that produced reasoning, tool progress, long Thinking output, and idle tool waits, then inspected Telegram messages and the gateway outbound Telegram send log.

Evidence after fix: Screenshot embedded below plus redacted outbound Telegram send-log metrics copied below: continuation msg=34783 -> msg=34786, final answer absent from every Thinking edit, zero bare Thinking sends, 20s timer edits at 04:20:15 -> 04:20:35 -> 04:20:55, and 99 outbound calls with 0 failures.

Observed result after fix: Thinking lane showed reasoning plus tool line, rolled into a continuation before the cap, sent the polished answer once as its own message, cleared empty Thinking output, and avoided Telegram 429s under the two-thread concurrent run.

What was not tested: No broad channel matrix or release package lane in this PR; focused local proof covers the Telegram renderer helpers, schema, lint, and extension typecheck.

Live proof (current head)

Captured on the current head with the default-off feature enabled, over a two-thread concurrent session. The screenshot shows the visible lane; the rest is verified from the gateway's outbound Telegram send log — every sendMessage / editMessageText the bot issues — which shows message-level behavior a screenshot can't (message ids, edit cadence, final-state content, timing). Wire-level facts below are message-level metrics (ids, lengths, ok/timing) and contain no command/path/host content.

Normal interleaving — reasoning + tool-use line in the Thinking lane, with the rolling timer:

interleaved lane

Wire-level verification (gateway send log, current head, one two-thread concurrent session):

  • Long-message continuationmsg=34783 grew to the 4000-char cap and rolled into a fresh continuation msg=34786 (carrying the next tool line) instead of freezing; clean seam, no garble.
  • No duplicate final answer — on that long thinking-heavy turn the final answer was delivered once as its own message and is absent from every Thinking edit of 34783/34786.
  • No empty Thinkingzero bare-Thinking-header sends across the session.
  • 20s rolling-timer cadence (rate-limit relief) — while idling on a blocking tool, the "still running" line re-edited at exactly 20s intervals (04:20:15 → 04:20:35 → 04:20:55, body static at 3764 chars), keeping concurrent Thinking messages under Telegram's edit rate. The wall-clock stamp exposes any genuine stall.
  • No rate-limiting99 outbound calls across the two concurrent threads, 0 failures (no 429s, no oversized-preview stop) — the exact concurrency that previously drew 429s.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. size: M labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 3, 2026, 4:48 AM ET / 08:48 UTC.

Summary
The branch adds Telegram streaming.progress.commentary config/schema/docs and routes Telegram preamble item events through the shared commentary progress renderer, with supporting progress-draft helper changes.

PR surface: Source +128, Tests +148, Docs +1, Generated 0. Total +277 across 13 files.

Reproducibility: yes. for the review finding: source inspection shows current main forwards preamble item events into Telegram progress drafts, while the PR returns before that fallback when commentary is unset. I did not run tests because this review is read-only.

Review metrics: 1 noteworthy metric.

  • Telegram progress defaults: 1 config option added; 1 default event path changed. The new setting changes whether existing Telegram preamble progress is visible without user action, so upgrade behavior matters before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Preserve current Telegram preamble progress by default, or document an explicit maintainer-approved breaking default change.
  • [P1] Add current-head real Telegram proof for streaming.progress.commentary: true and for the unset/default path, with private details redacted.
  • Refresh the PR body so the summary and proof describe the current commentary-progress diff rather than the earlier interleaved-progress branch.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The available screenshot/Mantis recording shows Telegram reasoning-preview behavior from an older scenario, not the current streaming.progress.commentary opt-in/default behavior at the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A native Telegram recording can directly show whether commentary appears only under the intended config and whether the default path preserves existing progress visibility. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram desktop proof: verify Telegram progress mode with streaming.progress.commentary enabled shows Codex preamble text, and with it unset preserves the intended default.

Risk before merge

  • [P1] Merging as-is would hide Telegram preamble/commentary progress by default for existing progress-mode users, even though current docs and shipped/current code expose it through the generic item-progress path.
  • [P1] The visible proof is for an older reasoning/interleaved preview scenario, not the current commentary config surface, so reviewers still lack current-head real Telegram proof for the changed behavior.

Maintainer options:

  1. Preserve the existing default (recommended)
    Keep Telegram preamble progress visible on the current default path and use the new option only to refine or disable commentary after docs/tests/proof are updated.
  2. Accept an intentional opt-in break
    Maintainers can choose the Discord-style opt-in behavior, but should require explicit release-note context, docs that call out the default change, and current-head Telegram proof before merge.
  3. Pause until the PR matches its purpose
    If the branch is no longer the interleaved-progress feature described in the body, pause for a cleaned-up PR body and proof package before further review.

Next step before merge

  • [P1] This needs contributor-updated real Telegram proof plus a maintainer decision on whether Telegram commentary progress may become opt-in by default.

Security
Cleared: No concrete security or supply-chain concern was found in the config/schema/docs and Telegram rendering changes.

Review findings

  • [P1] Preserve preamble progress by default — extensions/telegram/src/bot-message-dispatch.ts:1961-1965
Review details

Best possible solution:

Preserve the existing Telegram progress visibility by default, or get an explicit maintainer decision for a breaking opt-in, then align schema/docs/tests and attach current-head Telegram proof for both enabled and default paths.

Do we have a high-confidence way to reproduce the issue?

Yes for the review finding: source inspection shows current main forwards preamble item events into Telegram progress drafts, while the PR returns before that fallback when commentary is unset. I did not run tests because this review is read-only.

Is this the best way to solve the issue?

No. The commentary renderer path is plausible and matches the Discord pattern, but making Telegram preamble progress opt-in silently changes an existing documented default; the safer fix preserves the default unless maintainers explicitly approve the break.

Full review comments:

  • [P1] Preserve preamble progress by default — extensions/telegram/src/bot-message-dispatch.ts:1961-1965
    Current main and the latest release route every onItemEvent, including kind: "preamble", through the generic progress path, and the Telegram docs say Codex preamble/commentary progress is enabled by default. This branch intercepts preamble events and returns after pushCommentaryProgress; when the new commentary flag is unset, that helper returns false, so existing progress-mode users stop seeing those updates unless they discover and set a new option. Please keep the existing default behavior or make the breaking opt-in an explicit maintainer-approved upgrade change with matching docs and proof.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0b98aea71a52.

Label changes

Label changes:

  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The available screenshot/Mantis recording shows Telegram reasoning-preview behavior from an older scenario, not the current streaming.progress.commentary opt-in/default behavior at the current head.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The available screenshot/Mantis recording shows Telegram reasoning-preview behavior from an older scenario, not the current streaming.progress.commentary opt-in/default behavior at the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram progress-draft behavior, so a short Telegram Desktop proof would materially help review.
  • remove rating: 🌊 off-meta tidepool: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority Telegram feature/config change with a concrete compatibility risk but limited blast radius.
  • merge-risk: 🚨 compatibility: The PR adds a Telegram config surface and changes the default behavior for existing progress-mode users.
  • merge-risk: 🚨 message-delivery: The changed preamble branch can suppress Telegram progress messages that current code forwards into the progress draft.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The available screenshot/Mantis recording shows Telegram reasoning-preview behavior from an older scenario, not the current streaming.progress.commentary opt-in/default behavior at the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The available screenshot/Mantis recording shows Telegram reasoning-preview behavior from an older scenario, not the current streaming.progress.commentary opt-in/default behavior at the current head.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram progress-draft behavior, so a short Telegram Desktop proof would materially help review.
Evidence reviewed

PR surface:

Source +128, Tests +148, Docs +1, Generated 0. Total +277 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 6 141 13 +128
Tests 5 153 5 +148
Docs 1 1 0 +1
Config 0 0 0 0
Generated 1 4 4 0
Other 0 0 0 0
Total 13 299 22 +277

What I checked:

Likely related people:

  • Ayaan Zaidi: Recent current-main commits introduced the shared progress-draft compositor and Telegram progress-draft reasoning composition that this PR builds on. (role: recent area contributor; confidence: high; commits: a4b09d72b92b, 2a512025ad3e; files: src/channels/progress-draft-compositor.ts, src/channels/streaming.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • Vincent Koc: Current-main blame for the Telegram item-event forwarding path and Codex preamble projection points to this author in the available local history. (role: current behavior introducer; confidence: medium; commits: e38b8f6a201d; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/codex/src/app-server/event-projector.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg: 🎁 locked until real behavior proof passes.

Details
  • No creature or rarity is rolled until proof passes.
  • Eggs are collectible flavor only; they do not affect labels, ratings, merge decisions, or automation.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 27, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label May 27, 2026
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup. label May 27, 2026
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with current-head proof for all four behaviors:

  • Normal interleaving — screenshot of the Thinking lane (reasoning/tool line + rolling timer).
  • No duplicate final answer — wire-level (gateway outbound send log): reply text that transiently reached a Thinking message was stripped at delivery (edit length 1119 → 962); the answer was delivered once as its own message.
  • Long-message continuation — wire-level: a long turn's Thinking lane rolled from msg=34704 into a fresh continuation msg=34705 carrying the continued reasoning (and a separate ~4.0k-char turn rotated 34656 → 34660); visually confirmed clean at the seam.
  • No empty Thinking — wire-level: 0 bare-Thinking sends across 7 Thinking messages / 144 edits.

The send-log facts are message-level metrics (ids, lengths, ok/timing) with no command/path/host content; the screenshot is redacted. Remaining non-code item: maintainer acceptance of the two default-off config keys.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Pushed f533becacf2 + refreshed the body:

  • f533becacf2 — slow the interleaved rolling timer from 3s to 20s (INTERLEAVED_TIMER_INTERVAL_MS) and stamp the "still running" line with a wall-clock time. Field-testing under concurrent multi-thread load drew Telegram 429s (a 429 drops the edit and stalls the lane; a 429'd answer send is lost). The 3s tick re-edited every Thinking message every 3s even while idling on a long tool, flooding the per-chat edit rate; 20s keeps N concurrent Thinking messages under it, and the wall-clock stamp makes a genuine stall obvious.
  • Body — reframed deps: fix(agents/cli): bridge CLI tool_use lifecycle events to channel preview #80046 is now merged (the real prerequisite; branch should rebase onto current main), and feat(cli-output): emit thinking_delta events; handle redacted single-block shape #85381 demoted from "depends on" to prose (it only enriches CLI-native reasoning on the standard backend; the interactive backend restores thinking via the proxy, so it's not a hard dependency). Added a Verification block with the focused test commands.

Local: oxlint clean, tsgo clean, 48/48 telegram interleaved tests green. Remaining item is the Telegram maintainer sign-off on the two default-off config keys.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Pushed 81be8502f0f addressing the [P2] tagged-reasoning leak (reasoning-lane-coordinator.ts).

stripReasoningTagsForInterleaved stripped the <think> tokens but kept ALL content, so a payload like <think>reason</think>answer left answer in the Thinking lane — persisting the final answer into reasoning. Fix: when the payload carries reasoning tags (outside code), extract ONLY the in-tag reasoning via extractThinkingFromTaggedStreamOutsideCode and drop any prose after </think>, mirroring splitTelegramReasoningText. Untagged payloads (the interactive backend's thinking_delta) pass through unchanged; literal tags inside code are preserved. Tests updated to the split behavior + added unclosed-streaming-tag coverage.

Local: oxlint clean, tsgo clean, reasoning-lane-coordinator tests green. Remaining item is the Telegram maintainer sign-off on the two default-off config keys.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Refreshed the live proof to the current head (81be8502f0f) — the prior capture predated the timer + reasoning-tag commits. New capture is from a two-thread concurrent session on the rebuilt gateway:

  • Continuation spillmsg=34783 reached the 4000-char cap and rolled into a fresh continuation msg=34786 (next tool line carried over); clean seam.
  • No duplicate final answer — the answer is delivered once and is absent from every Thinking edit of 34783/34786.
  • No empty Thinking — 0 bare-Thinking sends.
  • 20s timer cadence — "still running" re-edited at exactly 20s intervals while idle (04:20:15 → 04:20:35 → 04:20:55).
  • No rate-limiting — 99 outbound calls across two concurrent threads, 0 failures (no 429s) — the concurrency that previously drew 429s.

Code is unchanged since the last review (patch already platinum); this only updates the proof to current head. Remaining item is the Telegram maintainer sign-off on the two default-off config keys.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

(Prior re-review run failed to finish — re-triggering. No changes since; the body already carries the refreshed current-head proof: continuation spill 34783→34786, no-dup, no empty Thinking, 20s timer cadence, and 0 429s across two concurrent threads.)

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@Peetiegonzalez

Peetiegonzalez commented May 30, 2026

Copy link
Copy Markdown
Contributor

I fully support this as normalisation of behaviours across similar channels. This would bring Telegram in line with Discord, which finally got fixed to show equivalent information to TUIs like Claude Code etc.. #85200, amongst others...
Here is my Discord for comparison (how it should be.. in Telegram)

image

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-mantis

openclaw-mantis Bot commented May 31, 2026

Copy link
Copy Markdown

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs for the Telegram reasoning preview.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-87072/run-26852608089-1/index.json

@clawsweeper

clawsweeper Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@obviyus

obviyus commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Scoped tests: node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts src/channels/progress-draft-compositor.test.ts src/channels/progress-draft-lines.test.ts src/config/schema.test.ts extensions/telegram/src/config-schema.test.ts src/plugin-sdk/channel-streaming.test.ts — 5 shards, 224 tests passed.
  • Checks: targeted oxfmt --check, plugin SDK API baseline check, bundled channel config metadata check, and git diff --check all passed.
  • Manual proof: triggered Claude Code through OpenClaw's Claude CLI provider path; final answer matched OPENCLAW_CLAUDE_PROGRESS_PROBE_OK, progress updates were emitted, and session/usage metadata was present.
  • GitHub proof: all current checks on the rebased head passed or skipped, including Real behavior proof, Critical Quality channel/config boundary, Security High channel-runtime-boundary, build artifacts, lint, prod types, test types, and dependency guard.
  • Changelog: not updated; normal PR release notes are handled by the PR body/release generation in this repo.
  • Land commit: 799a0af74fdd3f4bbb96ba1d0e9be46b78564357
  • Merge commit: 41ee6b1dd68c05864427388192505b1a23f48cc5

Thanks @anagnorisis2peripeteia!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: blank-template Candidate: PR template appears mostly untouched. triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants