Skip to content

fix(chat): export standalone reviver for workflow-safe deserialization#257

Open
haydenbleasel wants to merge 1 commit intomainfrom
243-durable-chat-sessions-guide-fails-with-workflow-node-module-error
Open

fix(chat): export standalone reviver for workflow-safe deserialization#257
haydenbleasel wants to merge 1 commit intomainfrom
243-durable-chat-sessions-guide-fails-with-workflow-node-module-error

Conversation

@haydenbleasel
Copy link
Contributor

Summary

  • Adds a standalone reviver function exported from chat that deserializes Thread/Channel/Message objects without requiring a Chat instance (and its adapter Node.js dependencies)
  • Updates Chat.reviver() to delegate to the standalone function internally
  • Updates the durable chat sessions guide to use reviver from chat and dynamically import bot inside "use step" functions

Closes #243

Test plan

  • pnpm validate passes (knip, lint, typecheck, tests, build)
  • New tests for standalone reviver in serialization.test.ts
  • Verify the updated guide pattern works with a real Vercel Workflow project

Importing the Chat instance into Vercel Workflow files pulls in adapter
packages that depend on Node.js modules, which aren't available in the
workflow sandbox. This adds a standalone `reviver` function exported from
`chat` that deserializes Thread/Channel/Message objects without needing
a Chat instance or its adapter dependencies.

Also updates the durable chat sessions guide to use the standalone
reviver and dynamic bot imports inside step functions.

Closes #243

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 16, 2026

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

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 Mar 16, 2026 8:10pm
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Mar 16, 2026 8:10pm

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.

Durable chat sessions guide fails with workflow-node-module-error

1 participant