Skip to content

feat(telegram): add native DM draft streaming with segmented stream results#340

Open
lurenjia534 wants to merge 4 commits into
vercel:mainfrom
lurenjia534:main
Open

feat(telegram): add native DM draft streaming with segmented stream results#340
lurenjia534 wants to merge 4 commits into
vercel:mainfrom
lurenjia534:main

Conversation

@lurenjia534
Copy link
Copy Markdown

Summary

Add native Telegram DM streaming via sendMessageDraft while preserving Chat SDK's existing post+edit fallback for non-DM threads.

This PR:

  • adds native private-chat draft streaming to the Telegram adapter
  • splits long streamed markdown into Telegram-safe persisted segments
  • retries without parse_mode when Telegram rejects markdown entity parsing
  • exposes segmented native stream results in the chat core
  • updates docs and feature matrices to reflect Telegram DM draft streaming

Test plan

  • pnpm check
  • pnpm typecheck
  • pnpm test:workspace
  • pnpm build

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 6, 2026

@lurenjia534 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@lurenjia534
Copy link
Copy Markdown
Author

Ah, I forgot to upload a video showing this PR

screen-20260407-075015-1775519367603-10mb.mp4

's effect it currently only works in private chats, since Telegram's official streaming API only allows us to use it in private conversations.

@bensabic bensabic requested a review from visyat May 9, 2026 12:21
# Conflicts:
#	README.md
#	apps/docs/content/docs/adapters.mdx
#	apps/docs/content/docs/index.mdx
#	apps/docs/content/docs/streaming.mdx
#	packages/adapter-telegram/README.md
#	packages/adapter-telegram/src/index.ts
#	packages/chat/src/thread.test.ts
#	packages/chat/src/thread.ts
@lurenjia534 lurenjia534 requested a review from a team as a code owner May 15, 2026 22:39
@lurenjia534
Copy link
Copy Markdown
Author

@visyat I resolved the merge conflict and pushed a follow-up fix for Telegram streaming segmentation.

The latest commit prevents streamed MarkdownV2 content from being truncated when the rendered Telegram payload grows beyond the original markdown source
length. I also added a regression test covering escaped MarkdownV2 expansion.

Verified locally:

  • pnpm --filter @chat-adapter/telegram test
  • pnpm check
  • pnpm typecheck
  • pnpm test:workspace
  • pnpm build

Could you take another look when you have a chance?

@slmnsh
Copy link
Copy Markdown
Contributor

slmnsh commented May 22, 2026

Hi @visyat, any updates on this?

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Canceled Canceled Open in v0 May 26, 2026 6:56am

@vercel vercel Bot temporarily deployed to Preview – chat May 26, 2026 06:56 Inactive
@lurenjia534
Copy link
Copy Markdown
Author

@visyat I synced the branch with the latest upstream main, including the CI Node version fix from #543.

I verified locally:

  • pnpm --filter @chat-adapter/telegram test
  • pnpm install --frozen-lockfile
  • pnpm validate

All passed.

The current GitHub Actions CI run is action_required with no jobs started, so it looks like it needs maintainer
approval to run for this fork PR. The remaining Vercel failures are deployment authorization checks, not test
failures.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants