Gitpulse
LatestReleasesStand-up
Developing
Size
XL
Extra Large: 1000+ weighted lines
Change Breakdown
Feature80%
Docs10%
Refactor10%
#3173feat(sdk): AI SDK custom useChat transport & chat.task harness

AI SDK chat transport being integrated for durable tasks

ER
ericallam
·#3173feat(sdk): AI SDK custom useChat transport & chat.task harness

Developers can now back their AI SDK `useChat` hooks with Trigger.dev's durable execution, enabling long-running AI conversations that survive page refreshes and network drops.

Here's the LatestUpdated as code changes

Building AI chat applications often means wrestling with timeouts and lost state if a user closes their tab mid-generation. By running the chat completion as a durable task, developers can ensure conversations are processed reliably in the background while keeping the frontend perfectly in sync.

A custom transport layer for the Vercel AI SDK is being introduced. Developers can connect the standard useChat hook to a backend Trigger.dev task. This means chat generations can run longer than standard serverless timeouts and automatically when a user returns to the page.

The frontend uses a new useTriggerChatTransport hook to manage connection state, while the backend utilizes a pre-configured chatTask wrapper to handle message parsing, tool execution, and stream piping. A complete reference Next.js application is also included to demonstrate state persistence across hard refreshes.

Here's how you'd use it in a React component:

tsx
1const transport = useTriggerChatTransport<typeof myChatTask>({
2 task: "my-chat-task",
3 accessToken: () => fetchToken(),
4});
5const { messages, sendMessage } = useChat({ transport });
This analysis will evolve. Full story with review threads and final assessment available after merge.
© 2026 · via Gitpulse