Skip to content

Add Telegram progress preview flows#83847

Merged
Patrick-Erichsen merged 5 commits into
mainfrom
pe/telegram-progress-preview-flows
May 19, 2026
Merged

Add Telegram progress preview flows#83847
Patrick-Erichsen merged 5 commits into
mainfrom
pe/telegram-progress-preview-flows

Conversation

@Patrick-Erichsen
Copy link
Copy Markdown
Contributor

@Patrick-Erichsen Patrick-Erichsen commented May 19, 2026

Summary

  • add a generic dev channel-message flow runner with Telegram support and thinking-final / working-final preview flows
  • make user-facing reasoning/progress labels render as Thinking and Working, with blank-line-separated progress details and no label animation
  • route the Telegram working-final flow through native sendMessageDraft while keeping the preview fixture aligned with production static-label behavior
  • tighten formatted reasoning detection so visible Thinking... replies are not swallowed, with Discord/Feishu/Telegram parser follow-through

Verification

  • git diff --check
  • node scripts/run-vitest.mjs test/scripts/channel-message-flows.test.ts
  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts test/scripts/channel-message-flows.test.ts
  • node scripts/run-vitest.mjs src/plugin-sdk/reply-payload.test.ts src/agents/tools/message-tool.test.ts extensions/telegram/src/reasoning-lane-coordinator.test.ts test/scripts/channel-message-flows.test.ts --run
  • node scripts/run-vitest.mjs extensions/discord/src/monitor/message-handler.process.test.ts extensions/discord/src/chunk.test.ts src/plugin-sdk/channel-streaming.test.ts src/infra/heartbeat-runner.returns-default-unset.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/mattermost/src/mattermost/reply-delivery.test.ts extensions/whatsapp/src/auto-reply/deliver-reply.test.ts --run
  • AUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --reviewer codex --fallback-reviewer none

Real behavior proof

Behavior addressed: Telegram progress previews can be locally exercised with flow fixtures, native Telegram tool-progress previews use sendMessageDraft, and progress/reasoning labels now render as static Working / Thinking labels.
Real environment tested: Local source checkout using the repo Vitest wrapper and autoreview.
Exact steps or command run after this patch: git diff --check; node scripts/run-vitest.mjs test/scripts/channel-message-flows.test.ts; node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts test/scripts/channel-message-flows.test.ts; node scripts/run-vitest.mjs src/plugin-sdk/reply-payload.test.ts src/agents/tools/message-tool.test.ts extensions/telegram/src/reasoning-lane-coordinator.test.ts test/scripts/channel-message-flows.test.ts --run; node scripts/run-vitest.mjs extensions/discord/src/monitor/message-handler.process.test.ts extensions/discord/src/chunk.test.ts src/plugin-sdk/channel-streaming.test.ts src/infra/heartbeat-runner.returns-default-unset.test.ts extensions/feishu/src/reply-dispatcher.test.ts extensions/mattermost/src/mattermost/reply-delivery.test.ts extensions/whatsapp/src/auto-reply/deliver-reply.test.ts --run; AUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --reviewer codex --fallback-reviewer none.
Evidence after fix: Focused touched-surface runs passed, including 86 Telegram flow/dispatch tests, 180 reasoning/flow tests, and 232 cross-channel reasoning/progress tests; final autoreview reported autoreview clean: no accepted/actionable findings reported.
Observed result after fix: The dev flow runner supports Telegram thinking-final and native sendMessageDraft working-final, both production and fixture progress labels are static, and formatted reasoning filters no longer treat visible Thinking... answers as hidden reasoning.
What was not tested: No live Telegram network send was rerun after the final native/static-label cleanup; earlier local previews drove the UX iteration.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling channel: feishu Channel integration: feishu size: L maintainer Maintainer-authored PR labels May 19, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

Codex review: needs real behavior proof before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
This PR adds Telegram channel-message preview flow tooling and changes progress/reasoning preview text to Thinking/Working across Telegram and related channel parsing surfaces.

Reproducibility: yes. for the PR blocker: source inspection shows the PR formatter emits Shelling\n\n..., while the Telegram slow status-reaction test at PR head still matches Shelling\n.... No current-main bug reproduction is applicable because this is a feature/UX PR.

PR rating
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Summary: The patch has a focused correctness blocker and only synthetic proof for visible Telegram transport behavior.

Rank-up moves:

  • Fix the remaining Telegram progress assertion and rerun the targeted Telegram/channel streaming tests.
  • Add redacted live Telegram Desktop or bot-to-bot proof showing Thinking and Working preview flows plus final delivery.
  • Update the PR body with proof so ClawSweeper can re-review automatically; if it does not, ask a maintainer to comment @clawsweeper re-review.
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.

PR egg
🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature, rarity, or ASCII portrait is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

Real behavior proof
Needs real behavior proof before merge: The PR body provides targeted tests and autoreview only, and explicitly says no live Telegram network send was rerun after the final parser/timer cleanup. 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 Desktop proof would directly show preview update behavior, cleanup, and durable final delivery that unit tests cannot prove. 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 thinking-final and working-final preview flows show Thinking/Working updates, clear or stop previews correctly, and deliver one durable final answer.

Risk before merge
Why this matters: - No live Telegram network proof after the final parser/timer cleanup means preview clear/stop and durable final delivery remain unproven outside tests.

  • Renaming reasoning/progress labels to Thinking/Working changes user-visible wording across channel surfaces, so maintainers should explicitly accept the compatibility impact before merge.
  • The PR has a protected maintainer label, so landing needs explicit maintainer handling even after the source blocker is fixed.

Maintainer options:

  1. Fix and prove Telegram live (recommended)
    Update the remaining Telegram progress assertion, rerun the targeted tests, and require redacted Telegram proof showing both preview flows update, clear or stop correctly, and deliver one durable final answer.
  2. Accept synthetic validation
    Maintainers can choose to merge with fixture/unit validation only if they intentionally accept the live transport timing and delivery uncertainty.
  3. Pause the wording change
    If the Thinking/Working terminology is not settled, pause or narrow the PR until the user-visible channel wording policy is approved.

Next step before merge
This needs contributor proof and maintainer/product review; the source defects are concrete, but missing real behavior proof keeps this out of automated repair routing.

Security
Cleared: No concrete security or supply-chain regression was found; the diff does not add dependencies, workflows, permissions, package metadata, or new secret persistence.

Review findings

  • [P2] Update the Telegram progress assertion — src/plugin-sdk/channel-streaming.ts:983
  • [P3] Fix the Thinking prefix comment — src/config/types.agent-defaults.ts:425
Review details

Best possible solution:

Fix the remaining Telegram progress assertion, rerun the targeted touched-surface tests, and land only after maintainers accept the wording change with redacted live Telegram proof.

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

Yes for the PR blocker: source inspection shows the PR formatter emits Shelling\n\n..., while the Telegram slow status-reaction test at PR head still matches Shelling\n.... No current-main bug reproduction is applicable because this is a feature/UX PR.

Is this the best way to solve the issue?

No, not yet; the direction is plausible, but the patch needs the remaining Telegram test expectation fixed and live Telegram proof before it is the best mergeable solution.

Label justifications:

  • P2: This is a normal-priority user-visible Telegram/channel improvement with a focused source blocker and limited blast radius.
  • merge-risk: 🚨 compatibility: The PR changes user-visible progress and reasoning wording from Reasoning/ellipsis labels to Thinking/Working across channel surfaces.
  • merge-risk: 🚨 message-delivery: The Telegram preview clear/stop plus durable final delivery path changes and lacks live transport proof after the final cleanup.

Full review comments:

  • [P2] Update the Telegram progress assertion — src/plugin-sdk/channel-streaming.ts:983
    formatChannelProgressDraftText now inserts a blank line between the label and detail lines, so this flow will update the draft as Shelling\n\n\🛠️ Exec``. The existing Telegram test still matches the old single-newline text, which should fail the targeted test file and leaves this behavior unproven.
    Confidence: 0.93
  • [P3] Fix the Thinking prefix comment — src/config/types.agent-defaults.ts:425
    The exported heartbeat config comment now says reasoning messages are prefixed with Thinking., but the new formatter emits Thinking followed by a blank line. Please keep the public type documentation aligned with the actual delivered prefix.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.91

Acceptance criteria:

  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts src/plugin-sdk/channel-streaming.test.ts test/scripts/channel-message-flows.test.ts src/infra/heartbeat-runner.returns-default-unset.test.ts src/agents/pi-embedded-utils.test.ts extensions/telegram/src/reasoning-lane-coordinator.test.ts src/plugin-sdk/reply-payload.test.ts src/agents/tools/message-tool.test.ts extensions/discord/src/chunk.test.ts extensions/discord/src/monitor/message-handler.process.test.ts extensions/feishu/src/reply-dispatcher.test.ts

What I checked:

Likely related people:

  • steipete: Git blame on current main attributes the shared progress label/formatter and Telegram progress draft code paths to commit 02f8fb7. (role: recent area contributor; confidence: medium; commits: 02f8fb7147c0; files: src/plugin-sdk/channel-streaming.ts, extensions/telegram/src/bot-message-dispatch.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 6fcfeed5dc67.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 19, 2026
Copy link
Copy Markdown
Contributor

@obviyus obviyus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup here. One request before merge: can you wire the label animation into the production Telegram native sendMessageDraft path too, or narrow the PR wording/tests so they do not imply native draft animation ships there?

Right now the dev working-final flow animates native drafts, but production native tool-progress formatting does not pass labelFrame, so sendMessageDraft appears to keep a stable label. Since this PR is UX-facing, the demo flow and production behavior should match.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels May 19, 2026
@Patrick-Erichsen
Copy link
Copy Markdown
Contributor Author

Patrick-Erichsen commented May 19, 2026

Addressed in 8941ca0af2: I took the “narrow the PR wording/tests” path rather than shipping native draft label animation.

Current behavior is now static labels end-to-end: production Telegram native sendMessageDraft tool progress uses Working, the working-final dev flow uses the same static label, and the PR body/proof no longer claims animated ellipses. I also fixed the review follow-ups from autoreview around forum thread handling and the progress gate callback type.

Verification after the cleanup included focused Telegram flow/dispatch tests, cross-channel reasoning/progress tests, and final autoreview clean against origin/main.


In plain english, I decided not to whole animated ellipsis thing after our convo about it potentially backing up other edits since Telegram has a 1RPS limit on updates.

@Patrick-Erichsen Patrick-Erichsen merged commit d60ab48 into main May 19, 2026
115 of 117 checks passed
@Patrick-Erichsen Patrick-Erichsen deleted the pe/telegram-progress-preview-flows branch May 19, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants