Skip to content

Migrate to Vercel AI SDK and update Next.js#36

Closed
Markeljan wants to merge 1 commit intomainfrom
claude/migrate-vercel-ai-sdk-3xFVM
Closed

Migrate to Vercel AI SDK and update Next.js#36
Markeljan wants to merge 1 commit intomainfrom
claude/migrate-vercel-ai-sdk-3xFVM

Conversation

@Markeljan
Copy link
Copy Markdown
Owner

This commit migrates the application from using OpenAI's Assistants API (threads/runs) to the modern Vercel AI SDK streamText chat API.

Key changes:

Package Updates:

  • Next.js 14.2 → 15.3 (with turbopack)
  • React 18 → React 19
  • react-markdown 8 → 10
  • next-auth updated to 5.0.0-beta.25
  • Updated Radix UI components to latest versions
  • Updated remark plugins for react-markdown v10 compatibility
  • Zod downgraded from v4 to v3 for AI SDK compatibility

API Migration:

  • Replaced /api/assistants/threads/messages with /api/chat
  • Migrated from AssistantResponse to streamText
  • Tools defined inline with Zod schemas and execute functions
  • Messages stored in Vercel KV instead of OpenAI threads

Component Updates:

  • Chat component: useAssistant → useChat hook
  • Updated ChatPanel, PromptForm, ChatList, ChatMessage for new API
  • AgentCard updated with onNewChat callback
  • Fixed react-markdown v10 breaking changes (removed className prop, linkTarget)

Next.js 15 Compatibility:

  • params/searchParams are now Promises (awaited in pages)
  • cookies() is now async (await cookies())
  • Updated Radix UI Portal components (removed className prop)
  • Fixed RefObject types for React 19

This commit migrates the application from using OpenAI's Assistants API (threads/runs)
to the modern Vercel AI SDK streamText chat API.

Key changes:

**Package Updates:**
- Next.js 14.2 → 15.3 (with turbopack)
- React 18 → React 19
- react-markdown 8 → 10
- next-auth updated to 5.0.0-beta.25
- Updated Radix UI components to latest versions
- Updated remark plugins for react-markdown v10 compatibility
- Zod downgraded from v4 to v3 for AI SDK compatibility

**API Migration:**
- Replaced `/api/assistants/threads/messages` with `/api/chat`
- Migrated from AssistantResponse to streamText
- Tools defined inline with Zod schemas and execute functions
- Messages stored in Vercel KV instead of OpenAI threads

**Component Updates:**
- Chat component: useAssistant → useChat hook
- Updated ChatPanel, PromptForm, ChatList, ChatMessage for new API
- AgentCard updated with onNewChat callback
- Fixed react-markdown v10 breaking changes (removed className prop, linkTarget)

**Next.js 15 Compatibility:**
- params/searchParams are now Promises (awaited in pages)
- cookies() is now async (await cookies())
- Updated Radix UI Portal components (removed className prop)
- Fixed RefObject types for React 19
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jan 12, 2026

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

Project Deployment Review Updated (UTC)
web3gpt Ready Ready Preview, Comment Jan 12, 2026 3:23pm

@Markeljan
Copy link
Copy Markdown
Owner Author

Closing as superseded by current main. The repo already uses /api/chat, @ai-sdk/react useChat, Next.js 15+ async params/cookies patterns, and newer package upgrades. The only divergence is that main retained extra legacy-thread compatibility on top of this migration.

@Markeljan Markeljan closed this Mar 30, 2026
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.

2 participants