fix(telegram): use native rich drafts for live previews#93438
Conversation
be5234c to
ae76bdc
Compare
|
This needs rebasing and a policy adjustment after #93279 landed. Current Best fix: rebase on |
8968c77 to
7fbb5e7
Compare
7fbb5e7 to
bfa36ea
Compare
|
Rebased onto latest |
bfa36ea to
bb0efd4
Compare
|
Rebased onto latest main and pushed exact head |
|
Codex review: needs real behavior proof before merge. Reviewed June 16, 2026, 1:29 AM ET / 05:29 UTC. Summary PR surface: Source +110, Tests +97. Total +207 across 6 files. Reproducibility: not applicable. as a PR review: this is a proposed Telegram transport capability rather than a standalone issue reproduction. The source path and targeted tests are clear, but the live Telegram runtime behavior remains unproven. Review metrics: 1 noteworthy metric.
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 detailsBest possible solution: Land the opt-in native draft path only after exact-head real Telegram proof shows richMessages-enabled private chats use native live previews and disabled or rejected paths remain readable fallback. Do we have a high-confidence way to reproduce the issue? Not applicable as a PR review: this is a proposed Telegram transport capability rather than a standalone issue reproduction. The source path and targeted tests are clear, but the live Telegram runtime behavior remains unproven. Is this the best way to solve the issue? Yes at code-shape level: using the existing account richMessages opt-in and preserving send/edit fallback is the narrowest maintainable path after the readable-default fix. It is not merge-ready until exact-head live Telegram proof covers the native draft path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7ac2bbaaf0ae. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +110, Tests +97. Total +207 across 6 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
|
bb0efd4 to
c2dccb7
Compare
|
Rebased onto latest |
|
Closing because this conflicts with the established Telegram streaming contract, not merely because live proof is missing. OpenClaw intentionally keeps one persistent preview message, edits it forward, and finalizes it in place. Native The existing account-scoped persistent rich preview path is the supported shape. Native draft methods should not be used for answer streaming unless the maintainer contract itself is deliberately changed with real Telegram proof and a one-bubble finalization design. Official draft behavior: https://core.telegram.org/bots/api#sendrichmessagedraft |
Summary
main.main; kept the readable default path intact.sendRichMessageDraftsupport for Telegram live previews only when the selected account hasrichMessagesenabled.sendMessage/editMessageTextfallback when rich transport is disabled or when native drafts are rejected.stream.temporary?.()now reports true only after a native draft has actually been delivered, so debounce-delayed flushes without a message id still preserve fallback delivery.Clean-branch scope
Validation
node scripts/run-vitest.mjs run extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/lane-delivery.test.ts --reporter=dotnode scripts/run-vitest.mjs run test/scripts/openclaw-cross-os-release-checks.test.ts --config test/vitest/vitest.tooling.config.ts --reporter=verbosegit diff --check origin/main...HEADplus conflict-marker scanReal behavior proof
sendRichMessageDraftfor temporary live previews only when rich messages are enabled for the selected account, rich-disabled or rejected native-draft paths stay on the standard send/edit preview fallback, and final reply persistence remains unchanged.c2dccb728891d70ada68acc6b8d1d6a5eec339cd.node scripts/run-vitest.mjs run extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/lane-delivery.test.ts --reporter=dotandnode scripts/run-vitest.mjs run test/scripts/openclaw-cross-os-release-checks.test.ts --config test/vitest/vitest.tooling.config.ts --reporter=verbose.Test Files 3 passed (3),Tests 218 passed (218), followed byTest Files 1 passed (1)andTests 89 passed (89). The same checkout reported no conflict markers and the diff remains limited to the six Telegram live-preview/progress source/test files.Current CI note
CIrun on this head has unrelated failures outside the Telegram diff:extensions/codex/src/app-server/bounded-turn.tstype errors, prompt snapshot drift, and plugin SDK surface budget drift. I reproduced the bounded-turn TypeScript error locally withpnpm tsgo:extensions; the PR diff remains limited to the six Telegram live-preview/progress files.Risk / rollback