Skip to content

fix(telegram): send progress previews as html text#94891

Merged
obviyus merged 1 commit into
mainfrom
codex/fix-telegram-progress-html-main
Jun 19, 2026
Merged

fix(telegram): send progress previews as html text#94891
obviyus merged 1 commit into
mainfrom
codex/fix-telegram-progress-html-main

Conversation

@obviyus

@obviyus obviyus commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • switch Telegram tool-progress previews to emit standard HTML previews when richMessages is off
  • keep richMessage previews only for the explicit richMessages === true transport
  • update progress-preview assertions to lock the false-mode contract to parseMode: "HTML"

Root Cause

Telegram progress draft rendering always produced a richMessage HTML preview shape, even when account config had richMessages off. The draft stream usually normalized that shape back into standard sendMessage/editMessageText with parse_mode: "HTML", but the producer contract was wrong and leak-prone: false-mode progress should never carry a raw rich-message payload.

Distill / Greybeard Pass

Distill: fixed the producer boundary instead of adding another fallback in draft-stream; false-mode now emits its actual transport shape directly, while rich-mode remains the only path that produces richMessage.

Greybeard: no hot-path optimization needed. The branch is stable per account config, and the patch does not add new per-line work beyond the existing progress HTML render/join path.

Verification

  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/bot-message-dispatch.test.ts -- --reporter=verbose
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S maintainer Maintainer-authored PR labels Jun 19, 2026
@obviyus obviyus self-assigned this Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 5:15 AM ET / 09:15 UTC.

Summary
Updates Telegram progress draft previews so non-rich accounts emit standard HTML text with parseMode: "HTML", while richMessages === true keeps the rich-message preview path, with focused test expectations adjusted.

PR surface: Source +9, Tests -28. Total -19 across 2 files.

Reproducibility: yes. Current main is source-reproducible: progress-mode dispatch always passes a richMessage preview even when the account is configured for non-rich standard Telegram transport.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until 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:

  • Attach a redacted Telegram Desktop or bot-to-bot proof showing non-rich progress previews render as formatted standard HTML text.
  • Update the PR body with the real environment, exact command or message used, observed result, and any private details redacted.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists tests and autoreview but no after-fix real Telegram proof for the visible progress-preview behavior. 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 proof would materially validate that the changed preview shape renders correctly in the real client. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify progress previews render as formatted HTML text when richMessages is off, and rich-mode previews still use rich messages.

Risk before merge

  • [P1] No live Telegram proof is attached for this visible streaming change; the PR body only lists synthetic tests and autoreview, while the Telegram maintainer note asks for real Telegram proof for streaming or transport PRs.

Maintainer options:

  1. Decide the mitigation before merge
    Land the producer-boundary fix after maintainer review, green focused checks, and real Telegram proof showing non-rich progress previews render as formatted standard HTML while rich mode still uses rich messages.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The maintainer-labelled Telegram streaming PR needs maintainer handling plus real Telegram proof; there is no narrow automated repair to queue.

Security
Cleared: The diff only changes Telegram runtime/test behavior and does not touch CI, dependencies, secrets, install scripts, or package supply-chain surfaces.

Review details

Best possible solution:

Land the producer-boundary fix after maintainer review, green focused checks, and real Telegram proof showing non-rich progress previews render as formatted standard HTML while rich mode still uses rich messages.

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

Yes. Current main is source-reproducible: progress-mode dispatch always passes a richMessage preview even when the account is configured for non-rich standard Telegram transport.

Is this the best way to solve the issue?

Yes. Fixing the producer boundary is the narrowest maintainable path because draft-stream already supports both standard HTML text and explicit rich-message transports, so adding another downstream fallback would preserve the wrong contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8aaf937bc045.

Label changes

Label changes:

  • add P2: The PR fixes a bounded Telegram progress-preview contract bug with limited channel-specific blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists tests and autoreview but no after-fix real Telegram proof for the visible progress-preview behavior. 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. This changes visible Telegram progress-preview formatting, which a short Telegram Desktop or bot-to-bot recording can demonstrate directly.

Label justifications:

  • P2: The PR fixes a bounded Telegram progress-preview contract bug with limited channel-specific blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists tests and autoreview but no after-fix real Telegram proof for the visible progress-preview behavior. 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: telegram-visible-proof: Mantis should capture Telegram visible proof. This changes visible Telegram progress-preview formatting, which a short Telegram Desktop or bot-to-bot recording can demonstrate directly.
Evidence reviewed

PR surface:

Source +9, Tests -28. Total -19 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 2 +9
Tests 1 51 79 -28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 62 81 -19

What I checked:

  • PR diff changes the progress preview producer boundary: The branch adds a richMessages parameter to renderTelegramProgressDraftPreview, returns { text: html, parseMode: "HTML" } when false, and preserves buildTelegramRichHtml only for rich mode. (extensions/telegram/src/bot-message-dispatch.ts:467, 1bf927ac4078)
  • Current main always produces a rich preview for progress drafts: On current main, renderTelegramProgressDraftPreview always returns a richMessage payload, regardless of the selected account's richMessages setting. (extensions/telegram/src/bot-message-dispatch.ts:467, 8aaf937bc045)
  • Standard stream text already uses Telegram HTML when rich messages are off: The existing dispatch renderer uses renderTelegramHtmlText plus parseMode: "HTML" when telegramCfg.richMessages !== true, so the PR aligns progress previews with the non-rich stream contract. (extensions/telegram/src/bot-message-dispatch.ts:906, 8aaf937bc045)
  • Draft stream supports standard HTML transport with plain fallback: normalizeTelegramDraftTransportPreview maps parseMode: "HTML" into standard text transport, and send/edit paths pass parse_mode: "HTML" with a plain-text fallback on Telegram HTML parse errors. (extensions/telegram/src/draft-stream.ts:91, 8aaf937bc045)
  • Existing config contract treats rich messages as explicit opt-in: Telegram config UI text states rich messages default to false because some current Telegram clients render them as unsupported, and channel action contract tests advertise rich text only when enabled. (extensions/telegram/src/config-ui-hints.ts:65, 8aaf937bc045)
  • Maintainer Telegram review note requires live proof for streaming changes: The Telegram maintainer note says behavior PRs touching transport or streaming need real Telegram proof, preferably bot-to-bot QA or an equivalent live Telegram probe. (.agents/maintainer-notes/telegram.md:35, 8aaf937bc045)

Likely related people:

  • obviyus: Prior merged history includes the rich HTML message work and progress-draft rendering changes that this PR adjusts, beyond authorship of this branch. (role: rich-message and progress-draft feature owner; confidence: high; commits: da92615816b6, 663fabbe30eb, 42dcf7075f2d; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/draft-stream.ts, extensions/telegram/src/rich-message.ts)
  • NianJiuZst: Authored the merged opt-in rich-message default restoration that established the current richMessages: false contract this PR follows. (role: default rich-message gating contributor; confidence: medium; commits: a375d6c84963; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/draft-stream.ts, extensions/telegram/src/config-ui-hints.ts)
  • vincentkoc: Recent merged commits touched Telegram command progress detail behavior and adjacent bot-message-dispatch tests in the same surface. (role: recent Telegram progress and dispatch test contributor; confidence: medium; commits: 5e329f40656a, d4fb49f3c495, 3d05da9a5483; files: extensions/telegram/src/bot-message-dispatch.test.ts, extensions/telegram/src/bot-message-dispatch.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.

@obviyus obviyus marked this pull request as ready for review June 19, 2026 09:11
@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. labels Jun 19, 2026
@obviyus obviyus force-pushed the codex/fix-telegram-progress-html-main branch from 1bf927a to 44788a2 Compare June 19, 2026 09:21
@obviyus obviyus merged commit a8b5f5d into main Jun 19, 2026
24 checks passed
@obviyus obviyus deleted the codex/fix-telegram-progress-html-main branch June 19, 2026 09:26

@ktmsxjrstar-creator ktmsxjrstar-creator left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's gooooo

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

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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