fix(telegram): clamp partial draft overflow#87644
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 9:29 AM ET / 13:29 UTC. Summary PR surface: Source +42, Tests +93. Total +135 across 2 files. Reproducibility: yes. The current-main source path is clear: an oversized non-final Telegram draft preview can enter the rollover/retain branch before finalization, and the linked issue includes release logs showing repeated preview sends. 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:
Mantis proof suggestion Next step before merge
Security Review detailsBest possible solution: Land the focused Telegram draft-stream fix after maintainer and CI review, keeping one editable partial preview while preserving final overflow delivery. Do we have a high-confidence way to reproduce the issue? Yes. The current-main source path is clear: an oversized non-final Telegram draft preview can enter the rollover/retain branch before finalization, and the linked issue includes release logs showing repeated preview sends. Is this the best way to solve the issue? Yes. The PR fixes the Telegram draft-stream owner path directly, gates rollover to finalization, and keeps final overflow splitting, which matches both the linked issue and the Telegram maintainer streaming note. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against a5eddb91bbd8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +42, Tests +93. Total +135 across 2 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
|
4dc2354 to
fcddb1b
Compare
|
Landed via rebase onto main.
|
Summary:
Verification:
pnpm test extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/lane-delivery.test.tsgit diff --checkReal behavior proof:
Behavior addressed: Telegram partial draft streaming no longer emits multiple visible preview messages for one turn.
Real environment tested: Real Telegram bot-to-bot group transport with temp OpenClaw gateway and mock OpenAI.
Exact steps or command run after this patch:
REPRO_GATEWAY_PORT=19979 REPRO_MOCK_PORT=19982 REPO_HEAD=$(git rev-parse --short=12 HEAD) node /tmp/repro-84885-telegram-partial.mjsEvidence after fix: One mock
POST /v1/responses; one reply-threaded SUT preview message; five edits to that preview; one final long-text overflow tail.Observed result after fix: No preview rollover spam; only the final long reply tail used a second message.
What was not tested: Visual desktop recording.
Fixes #84885.