fix(telegram): start partial draft previews immediately#79664
Closed
TurboTheTurtle wants to merge 1 commit into
Closed
fix(telegram): start partial draft previews immediately#79664TurboTheTurtle wants to merge 1 commit into
TurboTheTurtle wants to merge 1 commit into
Conversation
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
This was referenced May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
From
extensions/telegram/src/bot-message-dispatch.test.ts:Hiis emitted throughreplyOptions.onPartialReply.bot.api.sendMessage(123, "Hi", ...)before any final delivery.Hi therecallsbot.api.editMessageText(123, 777, "Hi there", ...).deliverRepliesis not called, proving the turn stayed on the preview/edit path instead of sending only a final Telegram message.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 --checkpnpm check:changed --base upstream/main