Repository navigation
fix(telegram): keep streamed final pages on word boundaries - #104608
Conversation
|
Land-ready evidence:
Known proof gap: the real Telegram three-chunk QA lane was attempted but could not acquire credentials because |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(telegram): keep streamed final pages on word boundaries This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 2:22 PM ET / 18:22 UTC. Summary PR surface: Source +17, Tests +36. Total +53 across 5 files. Reproducibility: yes. at source level: current main renders standard draft Markdown to HTML and then splits that HTML for final pages, while the trace demonstrates pages starting mid-token. A failing real-Telegram run was not established. Review metrics: none identified. 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: Keep the shared render-aware planner implementation and its specialized rich/raw path separation, then add a redacted Telegram Desktop recording or live transcript proving that a long streamed answer finalizes into complete pages without Telegram rejection. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main renders standard draft Markdown to HTML and then splits that HTML for final pages, while the trace demonstrates pages starting mid-token. A failing real-Telegram run was not established. Is this the best way to solve the issue? Yes. Reusing the durable render-aware Markdown planner is the narrowest maintainable fix, avoids a competing chunker, preserves rendered-length enforcement, and leaves specialized rich-message, raw HTML, and parse-fallback paths intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9ad59ae78802. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +17, Tests +36. Total +53 across 5 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
|
|
Merged via squash.
|
…ed final pagination (#104760) The behavior fix landed on main in #104608 (fe3884a): draft-stream final pagination now routes markdownSource previews through markdownToTelegramChunks, the same chunker the durable reply funnel uses (delivery.replies.ts buildChunkTextResolver), and the overflow-pagination golden was re-recorded on safe boundaries there. This adds the missing parity regression coverage: table-driven cases for mid-word, mid-entity, mid-tag, and fenced code-block page boundaries assert the streamed pages equal the durable chunker's HTML chunks exactly, and that retained/current page snapshots carry the durable plainText projection so an HTML-parse 400 degrades both funnels identically. Formatting proof: Testbox tbx_01kx9n9q7rksfxgr5baj0esw57 check:changed format lane passed on this diff (local worktree has no node_modules for the hook).
…#104608) * fix(telegram): align draft final pagination * chore: drop release-owned changelog entry * style(telegram): format pagination parity test
…ed final pagination (openclaw#104760) The behavior fix landed on main in openclaw#104608 (370bfff): draft-stream final pagination now routes markdownSource previews through markdownToTelegramChunks, the same chunker the durable reply funnel uses (delivery.replies.ts buildChunkTextResolver), and the overflow-pagination golden was re-recorded on safe boundaries there. This adds the missing parity regression coverage: table-driven cases for mid-word, mid-entity, mid-tag, and fenced code-block page boundaries assert the streamed pages equal the durable chunker's HTML chunks exactly, and that retained/current page snapshots carry the durable plainText projection so an HTML-parse 400 degrades both funnels identically. Formatting proof: Testbox tbx_01kx9n9q7rksfxgr5baj0esw57 check:changed format lane passed on this diff (local worktree has no node_modules for the hook).
Related: #102469
What Problem This Solves
Fixes an issue where users receiving long Telegram answers through draft streaming could see final pages split in the middle of words. Because those pages were split after HTML rendering, a boundary could also cut an entity or formatting span and cause Telegram to reject the page.
Why This Change Was Made
The standard Telegram draft renderer now retains the original Markdown and table mode, then final pagination uses the same render-aware
markdownToTelegramChunksplanner as durable delivery. Raw HTML and rich-message previews keep their existing specialized paths.User Impact
Long streamed Telegram answers now paginate at Markdown-aware word and block boundaries, matching durable sends and avoiding malformed HTML fragments.
Evidence
tbx_01kx95jqgtn54t9cgfjhcq900v: 292 focused Telegram tests passed on exact head, covering draft streaming, dispatch, and delivery traces.tbx_01kx94hed97fq1sf10pcqdgvj5:pnpm check:changedpassed, including extension and test typechecking, lint, import-cycle, and policy gates.channel-message-flowspassed withmock-openaiand theqa-channeldriver.th...and mid-line-number at30....OPENCLAW_QA_CONVEX_SITE_URL; no direct Telegram QA credentials are exported.