fix(telegram): start partial draft previews immediately#79682
fix(telegram): start partial draft previews immediately#79682TurboTheTurtle wants to merge 1 commit into
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(telegram): start partial draft previews immediately 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. |
|
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. |
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