Skip to content

Upgrade AI SDK from v4 to v6#975

Open
sethconvex wants to merge 7 commits intomainfrom
mission/ai-sdk-6
Open

Upgrade AI SDK from v4 to v6#975
sethconvex wants to merge 7 commits intomainfrom
mission/ai-sdk-6

Conversation

@sethconvex
Copy link
Copy Markdown

Summary

  • Upgrades the AI SDK (Vercel) from v4 to v6 across the entire codebase
  • Updates all imports, types, and API usage to match the new SDK version
  • Affects app components, chef-agent, test-kitchen, and convex modules (50 files changed)

Test plan

  • Verify chat functionality works end-to-end
  • Test tool calls and action runner
  • Verify message parsing and history loading
  • Run test-kitchen evals
  • Check usage tracking/billing still works correctly

🤖 Generated with Claude Code

Two-major-version jump (v4 → v6) covering:
- Package versions: ai@^6.0.0, @ai-sdk/*@^3.0.0
- Type renames: Message→UIMessage, CoreMessage→ModelMessage, LanguageModelV1→LanguageModel
- Tool definitions: parameters→inputSchema across all tool files
- Tool invocation states: partial-call→input-streaming, call→input-available, result→output-available
- Tool properties: .args→.input, .result→.output
- LanguageModelUsage fields: completionTokens→outputTokens, promptTokens→inputTokens
- Server streaming: createDataStream→createUIMessageStream, DataStreamWriter→UIMessageStreamWriter
- Client useChat: append→sendMessage, reload→regenerate, maxSteps→sendAutomaticallyWhen,
  onToolCall now uses addToolOutput, DefaultChatTransport replaces api+experimental_prepareRequestBody
- Annotations: message.annotations→message.metadata with new parsing
- UIMessage: removed .content, .createdAt, .toolInvocations; parts-based access throughout
- FilePart (model messages): .url→.data
- OpenAI provider: removed compatibility option
- Google Vertex: providerMetadata key vertex fallback to google
- SerializedMessage: explicit type definition for backward compat with stored messages
- Backward compat: legacy v4 tool states migrated on load in useInitialMessages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 11, 2026

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

Project Deployment Actions Updated (UTC)
chef Ready Ready Preview Mar 11, 2026 10:35pm

Request Review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The AI SDK upgrade accidentally removed these, causing Convex deploy
typecheck to fail on import.meta.glob.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update model names to claude-4.6-sonnet/claude-sonnet-4-6 while
keeping AI SDK v6 API structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant