Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0b81bb
feat(ai): align start event types with AG-UI
thruflo Feb 10, 2026
30d00e1
feat(ai): add MessageStreamState type for per-message stream tracking
thruflo Feb 10, 2026
f03493b
feat(ai): refactor StreamProcessor to per-message state
thruflo Feb 10, 2026
f036f55
feat(ai): replace STATE_SNAPSHOT with MESSAGES_SNAPSHOT event
thruflo Feb 10, 2026
3f1ccb5
feat(ai-client): add SessionAdapter interface and createDefaultSession
thruflo Feb 10, 2026
202244a
feat(ai-client): refactor ChatClient to use SessionAdapter subscripti…
thruflo Feb 10, 2026
d4cc2b1
fix(ai-preact): thread option through.
thruflo Feb 10, 2026
f45dd77
fix(ai): finalizeStream when RUN_FINISHED.
thruflo Feb 10, 2026
6d1c733
fix(ai-client): handle reload during active stream with generation co…
thruflo Feb 10, 2026
a217426
docs: remove proposal docs.
thruflo Feb 10, 2026
fd1c50c
fix(ai, ai-client): address stream lifecycle edge cases from PR review
thruflo Feb 10, 2026
8c628ee
fix(ai-client): fix reload failures from stale stream state and waite…
thruflo Feb 11, 2026
36d6a93
ci: apply automated fixes
autofix-ci[bot] Feb 11, 2026
2abc6c7
fix(ai): resolve eslint errors in stream processor
thruflo Feb 11, 2026
c5e1aa3
fix(ai-client): resolve eslint errors in chat-client and session-adapter
thruflo Feb 11, 2026
537b73c
fix(ai-client): propagate send() errors to subscribe() consumers
thruflo Feb 11, 2026
fc52ef7
fix(ai): map 'tool' role to 'assistant' in message state to fix lookups
thruflo Feb 11, 2026
ed1cddb
fix(ai): normalize chunk.delta to avoid "undefined" string concatenation
thruflo Feb 12, 2026
fd7c226
fix(ai): use || instead of ?? for chunk.delta fallback to satisfy eslint
thruflo Feb 12, 2026
64f5517
fix(ai): reset stream flags on MESSAGES_SNAPSHOT to avoid stale state
thruflo Feb 12, 2026
7155e87
refactor(ai-client): finalize connection adapter unification
samwillis Feb 18, 2026
1bcfdfe
Combine the SessionAdapter with the ConnectionAdapter
samwillis Feb 19, 2026
04e3e70
Merge branch 'main' into thruflo/durable-session-support
jherr Feb 23, 2026
fe307a1
ci: apply automated fixes
autofix-ci[bot] Feb 23, 2026
4e3a6cd
Merge remote-tracking branch 'origin/main' into thruflo/durable-sessi…
samwillis Mar 9, 2026
620ab8e
fix: return booleans from chat client streamResponse
samwillis Mar 9, 2026
098e07e
Merge remote-tracking branch 'origin/main' into thruflo/durable-sessi…
samwillis Mar 13, 2026
3b1c3b1
chore: add changeset for durable chat updates
samwillis Mar 13, 2026
3d858c1
feat: add sessionGenerating lifecycle for shared generation activity
samwillis Mar 3, 2026
ac7905e
fix: make stream finalization run-aware and fix reconnect message dedup
samwillis Mar 4, 2026
78bcfcb
fix: clean up framework client type exports
samwillis Mar 9, 2026
16f983c
chore: add changeset for subscription lifecycle updates
samwillis Mar 13, 2026
0503d13
Merge branch 'main' into pr-356-sub-lifecycle
jherr Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/fresh-donkeys-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@tanstack/ai': patch
'@tanstack/ai-client': patch
'@tanstack/ai-preact': patch
'@tanstack/ai-react': patch
'@tanstack/ai-solid': patch
'@tanstack/ai-svelte': patch
'@tanstack/ai-vue': patch
---

Add an explicit subscription lifecycle to `ChatClient` with `subscribe()`/`unsubscribe()`, `isSubscribed`, `connectionStatus`, and `sessionGenerating`, while keeping request lifecycle state separate from long-lived connection state for durable chat sessions.

Update the React, Preact, Solid, Svelte, and Vue chat bindings with `live` mode plus reactive subscription/session state, and improve `StreamProcessor` handling for concurrent runs and reconnects so active sessions do not finalize early or duplicate resumed assistant messages.
12 changes: 12 additions & 0 deletions .changeset/tidy-zebras-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@tanstack/ai': patch
'@tanstack/ai-client': patch
'@tanstack/ai-react': patch
'@tanstack/ai-solid': patch
'@tanstack/ai-svelte': patch
'@tanstack/ai-vue': patch
Comment on lines +2 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add @tanstack/ai-preact to this changeset.

packages/typescript/ai-preact/src/use-chat.ts changes the hook's public behavior and return state, but @tanstack/ai-preact is missing from the release plan here. Without an entry, those changes will not publish.

Suggested update
 '@tanstack/ai': patch
 '@tanstack/ai-client': patch
+'@tanstack/ai-preact': patch
 '@tanstack/ai-react': patch
 '@tanstack/ai-solid': patch
 '@tanstack/ai-svelte': patch
 '@tanstack/ai-vue': patch
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'@tanstack/ai': patch
'@tanstack/ai-client': patch
'@tanstack/ai-react': patch
'@tanstack/ai-solid': patch
'@tanstack/ai-svelte': patch
'@tanstack/ai-vue': patch
'@tanstack/ai': patch
'@tanstack/ai-client': patch
'@tanstack/ai-preact': patch
'@tanstack/ai-react': patch
'@tanstack/ai-solid': patch
'@tanstack/ai-svelte': patch
'@tanstack/ai-vue': patch
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/tidy-zebras-drum.md around lines 2 - 7, The changeset is missing
an entry for the package that had public API changes; add '@tanstack/ai-preact':
patch to the changeset so the modified hook in
packages/typescript/ai-preact/src/use-chat.ts (the useChat hook and its returned
state) gets published; update the list in .changeset/tidy-zebras-drum.md to
include that package name with the same release level (patch) as the other
packages.

---

Add durable `subscribe()`/`send()` transport support to `ChatClient` while preserving compatibility with existing `connect()` adapters. This also introduces shared generation clients for one-shot streaming tasks and updates the framework wrappers to use the new generation transport APIs.

Improve core stream processing to better handle concurrent runs and resumed streams so shared sessions stay consistent during reconnects and overlapping generations.
Loading