Skip to content

feat: update Vercel AI SDK to v6#282

Open
MentalGear wants to merge 7 commits intosqlrooms:mainfrom
MentalGear:claude/update-ai-core-vercel-OhHsc
Open

feat: update Vercel AI SDK to v6#282
MentalGear wants to merge 7 commits intosqlrooms:mainfrom
MentalGear:claude/update-ai-core-vercel-OhHsc

Conversation

@MentalGear
Copy link
Copy Markdown

Update packages/ai-core and related packages to use the latest Vercel AI SDK:

  • ai: 5.0.44 → 6.0.18
  • @ai-sdk/react: 2.0.44 → 3.0.18
  • @ai-sdk/openai-compatible: 1.0.18 → 2.0.4
  • @ai-sdk/openai: 2.0.32 → 2.0.38

Breaking changes addressed:

  • convertToModelMessages is now async, updated all call sites to await
  • Added new tool states: approval-requested, approval-responded, output-denied
  • Updated UIMessageSchema with approval workflow support
  • Fixed type guards and component props for new tool states

claude and others added 2 commits January 7, 2026 18:38
Update packages/ai-core and related packages to use the latest Vercel AI SDK:
- ai: 5.0.44 → 6.0.18
- @ai-sdk/react: 2.0.44 → 3.0.18
- @ai-sdk/openai-compatible: 1.0.18 → 2.0.4
- @ai-sdk/openai: 2.0.32 → 2.0.38

Breaking changes addressed:
- convertToModelMessages is now async, updated all call sites to await
- Added new tool states: approval-requested, approval-responded, output-denied
- Updated UIMessageSchema with approval workflow support
- Fixed type guards and component props for new tool states
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Do we need migration code for these changes?

@lixun910
Copy link
Copy Markdown
Collaborator

lixun910 commented Jan 7, 2026

Thanks 👍 I think it's better to update Vercel AI SDK v6 after I remove the openassistant dependencies: #280

@lixun910
Copy link
Copy Markdown
Collaborator

lixun910 commented Jan 7, 2026

Also, the agents in V6 is official now: https://vercel.com/blog/ai-sdk-6#agents We might need to update the related code in ai-core package.

claude and others added 5 commits January 7, 2026 20:08
Add comprehensive test suites to ensure v5 data continues to work with v6 schemas:

- UIMessageSchema.v5-compat.test.ts: Tests that v5 tool states (input-streaming,
  input-available, output-available, output-error) still validate correctly
- chatTransport.v5-compat.test.ts: Tests completeIncompleteToolCalls handles
  both v5 and v6 tool states properly
- utils.v5-compat.test.ts: Tests type guards (isToolPart, isDynamicToolPart,
  isTextPart, isReasoningPart) work with both v5 and v6 message formats

All 112 tests pass across 7 test suites, including 40 new backwards
compatibility tests.
- 40 tests → 11 tests
- 786 lines → 182 lines (77% reduction)
- Same coverage of essential v5→v6 compatibility scenarios
- Update agent framework docs to use ToolLoopAgent instead of Experimental_Agent
- Update tool parameters (inputSchema -> parameters)
- Add instructions parameter for agents (new in v6)
- Update embedding provider docs to use embedding() method instead of textEmbeddingModel()
- Update comments to reference AI SDK v6
@MentalGear
Copy link
Copy Markdown
Author

Changes should be additive. Some backwards compatibility tests were added. Also docs updated and Experimental_ removed for agents.

@mihajlo-stojkovic
Copy link
Copy Markdown
Collaborator

Hey @MentalGear, wanted to give you a heads-up since I'm working on something closely related.

I've been working on a PR (#423) that removes the openassistant dependency (as mentioned in issue #280), which was flagged as a prerequisite for the v6 upgrade. Once that lands, the path to v6 should be cleaner.

Are you still planning to continue this PR? Would love to avoid duplicating effort. If you are, I'd be happy to coordinate once the openassistant removal is merged. And if you've moved on, I'd be happy to take a stab at the v6 migration and build on the work you've started here.

Either way, thanks for the groundwork. It's a helpful reference!

@MentalGear
Copy link
Copy Markdown
Author

MentalGear commented Mar 12, 2026 via email

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.

4 participants