Skip to content

fix(telegram): start partial draft previews immediately#79664

Closed
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/telegram-partial-streaming
Closed

fix(telegram): start partial draft previews immediately#79664
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/telegram-partial-streaming

Conversation

@TurboTheTurtle

Copy link
Copy Markdown
Contributor

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

dispatchTelegramMessage passed DRAFT_MIN_INITIAL_CHARS to the draft stream for both partial and block modes. Short direct model partials in partial mode 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:

  • A direct model partial Hi is emitted through replyOptions.onPartialReply.
  • The real Telegram draft transport calls bot.api.sendMessage(123, "Hi", ...) before any final delivery.
  • The final answer Hi there calls bot.api.editMessageText(123, 777, "Hi there", ...).
  • deliverReplies is 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.ts
  • pnpm exec oxfmt --check --threads=1 extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.ts
  • git diff --check
  • pnpm check:changed --base upstream/main

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS r: too-many-prs Auto-close: author has more than twenty active PRs. labels May 9, 2026
@openclaw-barnacle

Copy link
Copy Markdown

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.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 9, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this May 9, 2026
@openclaw-barnacle

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram r: too-many-prs Auto-close: author has more than twenty active PRs. size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram streaming mode "partial" has no effect — only sendMessage ok in logs, no preview edits

1 participant