fix(telegram): start partial draft previews immediately#80002
fix(telegram): start partial draft previews immediately#80002TurboTheTurtle wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR resubmits the same partial-mode debounce removal that a maintainer already closed, and the remaining Telegram partial-streaming bug is canonically tracked for a debounce-preserving fix at #79605. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Keep #79605 as the canonical item and implement a Telegram fix that restores partial preview streaming without removing the 30-character first-preview debounce. Do we have a high-confidence way to reproduce the issue? Yes for the PR's source-level behavior: current main passes a 30-character first-preview threshold to Telegram partial mode, and the draft stream drops short initial updates below that gate. The linked live Telegram issue still needs logs or a smoke run to isolate why longer direct-model deltas are not producing preview edits. Is this the best way to solve the issue? No. This branch removes the partial-mode debounce that a maintainer already identified as intentional UX; the safer fix is to preserve that threshold and diagnose where usable text deltas stop reaching the Telegram draft stream. Security review: Security review cleared: The diff changes Telegram streaming logic and tests only; it does not add dependencies, workflows, scripts, secrets handling, or package-resolution behavior. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b6d63c0acd1f. |
977c2fd to
8de5d16
Compare
|
Refreshed this resubmission onto current |
8de5d16 to
5df43b3
Compare
|
One more refresh: |
|
Pushed Local validation on the pushed head:
The Real behavior proof gate is green on this head. The remaining ClawSweeper note is specifically asking for live Telegram bot/DM proof; I do not have a safe live bot/account runtime available in this environment, so that part still needs contributor-supplied live evidence if maintainers require it beyond the local dispatcher/draft-stream proof. |
58f5894 to
93ca67a
Compare
|
Rebased again onto current The conflict was in the shared plugin-install expectation tests; the previous compatibility commit is now obsolete because current main already carries the newer stable/beta install spec expectations. The branch now contains the Telegram partial-preview fix plus the still-needed plugin install npm-spec expectation adjustment. Validation after the rebase:
|
Resubmission of #79696 after GitHub rejected reopening the closed PR. Supersedes older closed drafts #79664, #79682, and #79696.
Summary
Fixes #79605.
Telegram partial preview mode now starts the draft preview immediately instead of applying the block-streaming first-message debounce. That preserves the debounce for block previews, while allowing direct model partial text to create the live Telegram preview before final delivery.
The regression test uses the real Telegram draft stream transport from the dispatcher test, emits a short direct partial (
Hi), verifies the draft transport sends the preview before final delivery, then verifies the final answer edits that preview instead of falling back to the normal final-send path.Root Cause
dispatchTelegramMessagepassedDRAFT_MIN_INITIAL_CHARSto the draft stream for bothpartialandblockmodes. Short direct model partials inpartialmode could stay below the 30-character initial threshold, so no visible Telegram preview was created even though partial callbacks reached the lane.Real behavior proof
Behavior or issue addressed: Telegram partial streaming should create the draft preview on the first short model partial instead of waiting for the 30-character block-mode debounce threshold.
Real environment tested: Local OpenClaw source checkout on macOS with Node/pnpm, exercising the Telegram dispatcher and draft stream transport paths in
extensions/telegram/src/bot-message-dispatch.test.tsandextensions/telegram/src/draft-stream.test.ts.Exact steps or command run after this patch:
pnpm test extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/draft-stream.test.ts src/plugin-sdk/channel-streaming.test.tsEvidence after fix: Copied terminal output from the focused Telegram streaming validation:
Observed result after fix: A direct model partial
HireachesreplyOptions.onPartialReply, the Telegram draft transport sends the preview message before final delivery, the final answerHi thereedits that preview, and the normal finaldeliverRepliespath is not used for that turn.What was not tested: A live Telegram DM screenshot or recording from a real bot account was not captured in this environment; the proof covers the OpenClaw Telegram dispatcher/draft-stream runtime path locally.
Validation
pnpm test extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/draft-stream.test.ts src/plugin-sdk/channel-streaming.test.tspnpm exec oxfmt --check --threads=1 extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.tsgit diff --check FETCH_HEAD