mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
8d88b8c0e2
* fix(github): accumulate stream before posting, log fallback edit errors
The GitHub adapter relied on chat-sdk's default fallbackStream which
posts a placeholder then edits it every 500ms. GitHub returns 422 on
these edits because body is empty during TTFT, and rapid edits risk
secondary rate limits.
Add stream() to GitHubAdapter that accumulates the full text before
posting once. Also log fallbackStream edit errors instead of silently
swallowing them.
* test: add tests for GitHub adapter stream() and fallbackStream logging
* style: format with biome
* refactor: use Logger instead of console.warn in fallbackStream
Plumb the Chat logger into ThreadImpl so fallbackStream uses the
structured logger instead of raw console.warn.
* test: simplify fallbackStream logging test
Reuse mockLogger from mock-adapter.ts and rely on createMockAdapter's
default editMessage mock instead of re-specifying the resolved value.
* test: use vi.mocked, drop redundant stream=undefined
* chore: add changeset
* refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters
* Revert "refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters"
This reverts commit 0a3ca3cc9a.