Skip to content

Commit f1a1d4f

Browse files
sync: upstream v4.29.0 (alpha 1) (#108)
Alpha sync starter for upstream chat@4.29.0 (release commit 6581d31, May 18 2026). Upstream skipped tagging chat@4.27.0 and chat@4.28.0; chat@4.29.0 is the next real tag. - Bumps version → 0.4.29a1 - Bumps UPSTREAM_PARITY → "4.29.0" - Updates README, CLAUDE.md, CHANGELOG with in-flight status and full porting plan Pre-audit (this session's scoping subagents) found two items already done in 0.4.27 — no work needed: - vercel/chat#446 (Telegram MarkdownV2 streaming-chunk safety trim) — PR #89 helpers cover it - vercel/chat#475 (private → protected internals) — Python _underscore convention already provides this Detailed scope, design issues (#109 chat/ai, #110 Messenger), and open questions in CHANGELOG entry. Tracking issue: #98.
1 parent c43ea05 commit f1a1d4f

5 files changed

Lines changed: 152 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,147 @@
11
# Changelog
22

3+
## 0.4.29a1 (2026-05-28)
4+
5+
Alpha sync starter for upstream `4.29.0` (`vercel/chat` release commit
6+
`6581d31`, May 18 2026). Upstream skipped tagging `chat@4.27.0` and
7+
`chat@4.28.0` (only `@chat-adapter/shared@4.27.0` and `@chat-adapter/shared@4.28.0`
8+
got tags); `chat@4.29.0` is the next real tag and the target of this
9+
wave. **No feature ports in this release** — parity-bookkeeping bump
10+
that sets `UPSTREAM_PARITY = "4.29.0"` and lays out the porting plan
11+
below.
12+
13+
Each substantive commit lands as its own PR (matching the cadence used
14+
during the 4.27 sync: #83, #85, #86, #87, #88, #89, #90, #91, #92, #99,
15+
#101, #103, #104, #105). Tracking issue: #98.
16+
17+
### Sync scope (37 substantive upstream commits between `f55378a..chat@4.29.0`)
18+
19+
#### Core (`packages/chat`)
20+
21+
- [ ] **`chat/ai` subpath for AI SDK utilities** (vercel/chat#492). New
22+
public API surface: `createChatTools`, `toAiMessages` for LLM/agent
23+
integration. Vercel AI SDK is TS-only; the Python equivalent needs a
24+
design call (see open question). Likely the biggest single PR in the
25+
wave.
26+
- [ ] **`queue-debounce` concurrency strategy** (vercel/chat#495). New
27+
strategy beyond the existing `drop` / `queue` / `debounce` /
28+
`concurrent`.
29+
- [ ] **Transcripts API + per-thread cache rename to `threadHistory`**
30+
(vercel/chat#448). New API surface; the cache rename has chinchill-api
31+
blast radius.
32+
- [ ] **`callbackUrl` on buttons and modals** (vercel/chat#454).
33+
- [ ] **`message.subject` + adapter client access** (vercel/chat#459).
34+
35+
#### All adapters
36+
37+
- [ ] **`adapter.client` rename → `adapter.octokit` / `adapter.linearClient`
38+
/ `adapter.webClient`** (vercel/chat#478). Public API rename across
39+
all adapters; deprecation shims advisable for one release.
40+
- [x] **`private``protected` for subclassing** (vercel/chat#475).
41+
Already addressed — Python convention uses `_underscore` (de-facto
42+
protected); audit confirmed no `__name_mangled` internals across all
43+
8 adapters. No work needed.
44+
45+
#### Slack (`packages/adapter-slack`)
46+
47+
- [ ] **Native `markdown_text` for outgoing messages** (vercel/chat#440).
48+
Was listed as "deferred" in 0.4.27.
49+
- [ ] **External installation provider for bot token management**
50+
(vercel/chat#467). Multi-workspace token mgmt extension.
51+
- [ ] **Flip `webhook_verifier > signing_secret` precedence**
52+
(vercel/chat#468). Our 0.4.27 explicitly went the other direction
53+
("match upstream" intent, with comment). Upstream has since reversed
54+
itself in #468. The comment on `adapter.py:385` is now stale; flip
55+
precedence + refresh comment + update tests.
56+
- [ ] **Expose direct `WebClient` via `adapter.client`** (vercel/chat#471,
57+
reverted in #472, reapplied in #476). Pairs with the #478 rename.
58+
59+
#### Discord (`packages/adapter-discord`)
60+
61+
- [ ] **Handle interactions in gateway-only mode** (vercel/chat#490).
62+
Related to issue #57 (Discord native Gateway). Decide if Gateway
63+
support lands in this wave or stays on a separate track.
64+
65+
#### Telegram (`packages/adapter-telegram`)
66+
67+
- [ ] **Typed attachment uploads** (vercel/chat#485). Bundled with
68+
related Telegram polish.
69+
- [ ] **`video_note` (round video messages) in `extractAttachments`**
70+
(vercel/chat#457).
71+
- [x] **MarkdownV2 entity safety trim to streaming chunks**
72+
(vercel/chat#446). Already addressed in our 0.4.27 — the
73+
`_trim_to_markdown_v2_safe_boundary` / `_find_unclosed_link_dest_open_bracket`
74+
/ `_slice_to_utf16_units` helpers from PR #89 cover this. No work
75+
needed.
76+
77+
#### Teams (`packages/adapter-teams`)
78+
79+
- [ ] **Migrate to `microsoft-teams-apps` SDK** (issue #93). Replaces our
80+
hand-rolled Bot Framework REST streaming with `ctx.stream.emit()`.
81+
Requires Python 3.12 floor bump. Headline Teams change for this wave
82+
(or 0.4.29.1 if the migration slips).
83+
84+
#### New packages
85+
86+
- [ ] **`@chat-adapter/messenger`** (vercel/chat#461). Brand-new Meta
87+
Messenger Platform adapter. Similar scope to porting WhatsApp or
88+
Telegram from scratch — own file tree under `src/chat_sdk/adapters/messenger/`,
89+
full webhook / message / attachment surface, ~1,500 LOC estimate.
90+
- [⏭️] **`@chat-adapter/web`** (vercel/chat#444). Vue + Svelte browser
91+
UI for chat-sdk bots. **Out of scope** — no browser runtime in
92+
chat-sdk-python.
93+
- [ ] **`@chat-adapter/tests` test kit** (vercel/chat#470). Test
94+
utilities for adapter authors. We already have an adapter-test
95+
pattern; evaluate whether to mirror.
96+
97+
#### Out of scope for this Python port
98+
99+
- **`@chat-adapter/web`** as above.
100+
- **Documentation site changes**`apps/docs/`, MDX refreshes, etc.
101+
- **Vercel-specific release/CI automation** (#465, #466, #511, #512,
102+
#520).
103+
104+
### Open questions (resolve before implementation)
105+
106+
1. **`chat/ai` subpath — Python design.** Detailed scoping in design
107+
issue (see below). Recommended shape: shared SDK-agnostic core in
108+
`chat_sdk/ai/tools.py` + thin per-SDK adapters (Anthropic, OpenAI)
109+
via optional extras (`chat-sdk-python[ai-anthropic]`,
110+
`chat-sdk-python[ai-openai]`). 17 tool factories + the existing
111+
`to_ai_messages` (already in `chat_sdk/ai.py`). ~7 engineer-days.
112+
Three sub-questions: approval-flow contract, hand-written JSON
113+
Schema vs Pydantic v2, ship OpenAI extras in first cut?
114+
2. **Messenger adapter (vercel/chat#461) — Python port.** Detailed
115+
scoping in design issue (see below). Mirrors WhatsApp adapter
116+
conventions; ~1,500 LOC prod + ~2,500 LOC tests; 2 PRs (scaffolding
117+
then adapter); ~5–6 days. Three sub-questions: init-failure
118+
semantics, postback `value` passthrough, signature-failure HTTP
119+
status code (upstream returns 403, our other adapters return 401).
120+
3. **Cadence**: ship as one wave (4.27 → 4.29) or split into 0.4.28
121+
then 0.4.29?
122+
4. **Python floor bump to 3.12** (required for Teams SDK migration —
123+
issue #93). Confirm chinchill-api compatibility before committing.
124+
5. **Discord Gateway scope**: ship Gateway support in this wave
125+
(issue #57) or keep gateway-only mode fix (vercel/chat#490)
126+
isolated?
127+
6. **`adapter.client` rename**: ship deprecation shim for one release,
128+
or hard cutover?
129+
130+
### Workflow
131+
132+
1. This alpha PR establishes the sync. CI on this draft is intentionally
133+
not invoked (lint.yml is gated on `!github.event.pull_request.draft`).
134+
2. Each item above lands as its own PR. Each port PR:
135+
- Updates the relevant `MAPPING` / fidelity coverage and removes its
136+
entries from `scripts/fidelity_baseline.json` if previously baselined.
137+
- Bumps lint.yml's pinned upstream ref to `chat@4.29.0` (the new tag)
138+
once the first feature port lands.
139+
- Adds an entry under the next CHANGELOG heading (`0.4.29a2`,
140+
`0.4.29a3`, …).
141+
3. Once all items are ported (or explicitly documented as divergence in
142+
`docs/UPSTREAM_SYNC.md`), the final PR cuts `0.4.29` and switches CI
143+
back to strict fidelity at the upstream tag.
144+
3145
## 0.4.27 (2026-05-28)
4146

5147
Synced to upstream `vercel/chat@4.27.0` (release commit `f55378a`, Apr 30 2026). Highlights: Slack Socket Mode + dynamic bot-token resolver, Teams native DM streaming, `chat.get_user()` across all 8 adapters, Telegram MarkdownV2 rendering, and a sweep of adapter bug fixes. Sets `UPSTREAM_PARITY = "4.27.0"`.

CLAUDE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Claude Code Quick Reference -- chat-sdk-python
22

33
## What is this?
4-
Python port of [Vercel Chat SDK](https://github.com/vercel/chat) (synced to v4.27.0; last fully-synced release `0.4.27`). Multi-platform async chat framework.
4+
Python port of [Vercel Chat SDK](https://github.com/vercel/chat) (porting v4.29.0; last fully-synced release `0.4.27` at upstream `4.27.0`). Multi-platform async chat framework.
55

66
## Key Commands
77
```bash
@@ -24,7 +24,8 @@ Our version embeds the upstream Vercel Chat version: `0.{upstream_major}.{upstre
2424
- `0.4.25.1` = Python-only fix on top of `4.25.0`
2525
- `0.4.26` = synced to upstream `4.26.0`
2626
- `0.4.26.3` = Python-only fixes on top of `4.26.0`
27-
- `0.4.27` = synced to upstream `4.27.0` (current release)
27+
- `0.4.27` = synced to upstream `4.27.0`
28+
- `0.4.29a1` = alpha while porting upstream `4.29.0` (current branch; upstream skipped 4.28 tag)
2829
- `UPSTREAM_PARITY` constant in `__init__.py` = programmatic access
2930

3031
## Architecture
@@ -107,8 +108,9 @@ will not pass CI.
107108

108109
**Fidelity check** (`scripts/verify_test_fidelity.py`) verifies every TS
109110
`it("...")` in the mapped core files has a matching Python `def test_*()`,
110-
pinned to `chat@4.26.0` (the last fully-synced upstream tag — `chat@4.27.0`
111-
is in flight; pin moves as ports land in this sync cycle). The `MAPPING`
111+
pinned to `chat@4.26.0` (upstream skipped tagging `chat@4.27.0` and
112+
`chat@4.28.0`, then resumed at `chat@4.29.0`; pin moves to `chat@4.29.0`
113+
once the in-flight 4.29 sync lands). The `MAPPING`
112114
dict in that script is the authoritative scope list — it currently covers 8
113115
of 17 `packages/chat/src/*.test.ts` files (extending it is tracked as a
114116
follow-up). **CI runs `--strict`** (see `.github/workflows/lint.yml`):
@@ -119,7 +121,7 @@ retained for local workflows where a few ports land in flight —
119121
regenerate via `--update-baseline` after documenting intentional
120122
divergence in `docs/UPSTREAM_SYNC.md`. During this sync cycle baseline
121123
mode reports a parity mismatch (baseline pinned at `chat@4.26.0`,
122-
`UPSTREAM_PARITY` says `4.27.0`); that's the intended signal until the
124+
`UPSTREAM_PARITY` says `4.29.0`); that's the intended signal until the
123125
sync lands.
124126

125127
Before the fidelity check can run locally, clone the pinned upstream

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Multi-platform async chat SDK for Python. Port of [Vercel Chat](https://github.com/vercel/chat).
99

10-
> **Status: 0.4.27**synced to upstream [Vercel Chat 4.27.0](https://github.com/vercel/chat) (release commit `f55378a`). See [CHANGELOG.md](CHANGELOG.md) for release notes and [docs/UPSTREAM_SYNC.md](docs/UPSTREAM_SYNC.md) for the known non-parity list.
10+
> **Status: Alpha (0.4.29a1porting [Vercel Chat 4.29.0](https://github.com/vercel/chat))** — API may change. Last fully-synced release: `0.4.27` (parity with upstream `chat@4.27.0`). See [CHANGELOG.md](CHANGELOG.md) for the in-flight sync plan.
1111
1212
## Why chat-sdk?
1313

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "chat-sdk"
3-
version = "0.4.27"
3+
version = "0.4.29a1"
44
description = "Multi-platform async chat SDK for Python — port of Vercel Chat"
55
keywords = [
66
"chat",

src/chat_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
)
192192

193193
# The upstream Vercel Chat version this release is synced to.
194-
UPSTREAM_PARITY = "4.27.0"
194+
UPSTREAM_PARITY = "4.29.0"
195195

196196
__all__ = [
197197
"UPSTREAM_PARITY",

0 commit comments

Comments
 (0)