Skip to content

feat(chat): allow disabling fallback streaming placeholder#139

Merged
haydenbleasel merged 7 commits intovercel:mainfrom
vincenzodomina:feat/fallback-stream-no-placeholder
Mar 1, 2026
Merged

feat(chat): allow disabling fallback streaming placeholder#139
haydenbleasel merged 7 commits intovercel:mainfrom
vincenzodomina:feat/fallback-stream-no-placeholder

Conversation

@vincenzodomina
Copy link
Contributor

@vincenzodomina vincenzodomina commented Feb 28, 2026

Summary

  • Add fallbackStreamingPlaceholderText?: string | null to ChatConfig.
  • Preserve null through Chat and ThreadImpl so fallback streaming can skip the initial "..." post.
  • Keep the default behavior unchanged: omitting the option still posts "..." immediately.

Motivation

Issue #140 only needs a way to suppress the initial placeholder on post+edit fallback adapters (for example Telegram), so this PR keeps the change scoped to that behavior.

When the placeholder is null, the first real streamed chunk creates the message and the existing edit loop continues from there.

See issue: #140

Test plan

  • pnpm --dir packages/chat exec vitest run src/thread.test.ts src/chat.test.ts
  • pnpm --dir packages/chat run typecheck

Add ChatConfig options to delay initial post+edit placeholder and wait for real text before creating the streamed message. Improves ordering for Telegram and other fallback-streaming adapters.

Made-with: Cursor
@vercel
Copy link
Contributor

vercel bot commented Feb 28, 2026

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

A member of the Team first needs to authorize it.

@haydenbleasel
Copy link
Member

haydenbleasel commented Mar 1, 2026

Thanks for the contribution @vincenzodomina! 🙌

I pushed a few small fixes on top of your work:

  • Added a missing test for the empty stream + placeholder=null edge case
  • Replaced the (customChat as any).createThread test with one that exercises the full Chat → Thread pipeline through public APIs (less fragile)
  • Sorted interface members alphabetically to pass the Ultracite linter
  • Added a changeset
  • Updated the docs

Full validation passes — should be good to go!

@vercel
Copy link
Contributor

vercel bot commented Mar 1, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
chat Ignored Ignored Open in v0 Mar 1, 2026 3:14am

@haydenbleasel haydenbleasel merged commit f5a75c9 into vercel:main Mar 1, 2026
7 of 8 checks passed
@vincenzodomina
Copy link
Contributor Author

Whoa thanks for the fast merge!

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.

2 participants