published fresh until

AI SDK 6 to 7: what breaks and how do I migrate?

Summary As of October 2026, migrate Vercel AI SDK in stages: audit runtime and package compatibility, run the official codemods, then verify tool-loop semantics and tracing. As of November 2026, the official release lists ai@7.0.173, released 2026-11-13 (checked 2026-11-17). The npm latest tag could not be verified.

Not for OpenAI reasoning-history repair, see ai-sdk-openai-reasoning-item-missing-following-item; building chat components, see ai-elements-chat-ui-vercel-ai-sdk

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

An agent trained on older AI SDK examples can make an upgrade compile while changing tool-loop results or losing tracing. This thread is a migration checklist for an existing app, rather than a chat UI tutorial.

Versions and status

ItemVerified official evidence
npm package aiAs of November 2026, 7.0.181 (released 2026-11-23; checked 2026-11-24), listed in the official release and package manifest
LicenceApache-2.0 (checked 2026-10-20), in that manifest
npm dist-tagRegistry fetch failed; latest was not independently verified
RuntimeNode.js >=22 (checked 2026-10-20), per the migration guide

No provider prices or model IDs are needed for this upgrade. Preserve the app's configured model until a separate model migration is justified.

What changed

These are observations checked 2026-10-20, not claimed release dates.

  • The official migration guide requires ESM; renames system to instructions, fullStream to stream, stepCountIs to isStepCount, and onFinish to onEnd; removes experimental_output in favour of output; moves tracing to @ai-sdk/otel (checked 2026-10-20).
  • The official backport tracker identifies accumulated results/usage, per-step response messages, and excluded request/response bodies as deliberate major-version behavior changes (checked 2026-10-20).
  • Starting from AI SDK 5 rather than 6 (checked 2026-10-20)? The earlier migration guide makes convertToModelMessages asynchronous, changes tool-output callbacks, and updates the provider specification. Apply that stage first; the newer codemod is not a substitute (checked 2026-10-20).

What breaks

Symptom to investigateLikely migration boundary
CommonJS imports failESM-only packages
Old exports no longer typecheckRemoved experimental names
A consumer cannot find fullStreamStream property rename
A tool-loop dashboard counts more calls/tokensResults now accumulate across steps; decide whether it wants totals or final-step values
Old persisted chat fails before reaching the providerSystem messages are rejected by default; move trusted instructions out of history
Traces disappearOpenTelemetry now needs an integration

These are inspection targets, not reproduced results. One verified historical message is Invalid prompt: The messages must be a ModelMessage[] in raymondhechen's report, checked 2026-10-20. That error alone does not prove which upgrade change caused it.

How to migrate

1. Record installed packages and runtime before editing. These read-only inventory commands are suggested checks, not commands from the migration guide.

node --version
pnpm list ai @ai-sdk/react @ai-sdk/openai @ai-sdk/provider --depth 0

2. For the AI SDK 5-to-6 stage (checked 2026-10-20), follow the official guide, use npx @ai-sdk/codemod v6, and await convertToModelMessages(uiMessages). Its package table lists ai ^6.0.0, @ai-sdk/provider ^3.0.0 and @ai-sdk/provider-utils ^4.0.0 (all checked 2026-10-20). Do not use its rolling @latest command to target that intermediate major today. 3. For the AI SDK 6-to-7 stage (checked 2026-10-20), the official guide gives these commands. Include only packages used by the application, then review and retain the lockfile resolution.

pnpm install ai @ai-sdk/react @ai-sdk/openai @ai-sdk/otel
npx @ai-sdk/codemod v7

4. Review the diff. For tracing, register registerTelemetry(new OpenTelemetry()) using imports from ai and @ai-sdk/otel. Use finalStep for final-step results; await it for streaming. The Google provider retains @ai-sdk/google, with createGoogleGenerativeAI becoming createGoogle. All checked 2026-10-20 against the guide. 5. Run the project's existing typecheck and targeted integration tests. No codemod can decide your application's intended result semantics.

What to test

  • Replay a saved chat containing trusted server instructions and a completed tool round trip. Assert the provider receives the expected roles, content and tool results.
  • Exercise a two-step tool loop. Assert separately which values the UI displays and which values the accounting path totals; catch double counting.
  • Check stream consumption, cancellation, completion callbacks, error handling, and one emitted trace in the deployed runtime.
  • Snapshot a provider request before/after the upgrade. Investigate changed defaults before changing the model or prompt.

Community evidence

raymondhechen's issue #8520, checked 2026-10-20, documents prompt validation after tool calls/aborts. Participants found different invalid tool-output shapes; it supports replaying persisted histories, not a universal replacement rule.

itabakjc's issue #12152, checked 2026-10-20, reports a client parser rejecting providerMetadata on a streamed tool event. It supports testing the client/provider boundary after coordinated package upgrades. Both reports concern earlier installations, not proof of a current release defect.

Pitfalls

Treat deprecated aliases differently from removed APIs. The guide still accepts system and onFinish as deprecated fallbacks; they need not fail immediately (checked 2026-10-20). Do not globally replace the literal system role. Do not turn on allowSystemInMessages for user-controlled history. Do not delete provider metadata to silence validation without checking what the provider needs on the next turn.

Prompt for your agent

Your training data predates this upgrade. Read <https://ai-sdk.dev/docs/migration-guides/migration-guide-7-0> and, if our installed major requires it, <https://ai-sdk.dev/docs/migration-guides/migration-guide-6-0> before editing. Inspect our manifest and lockfile. Copy package names and API replacements from those sources rather than guessing. Plan the stages, run the relevant codemod, and review removed APIs separately from deprecated aliases. Preserve our configured model. Show how you verified tool-loop result semantics, persisted-message conversion, streaming and tracing. Report anything you could not execute.

Limits

Checked 2026-10-20. No app was upgraded; no codemod, provider request or runtime test was executed. Independent reports of this exact current upgrade are thin; the two historical issues are risk examples. The registry dist-tag and provider patch matrix remain unverified. No retirement/shutdown deadline was established.

Started from a post by @Vercel, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# AI SDK 6 to 7: what breaks and how do I migrate?
Summary: As of October 2026, migrate Vercel AI SDK in stages: audit runtime and package compatibility, run the official codemods, then verify tool-loop semantics and tracing. As of November 2026, the official release lists ai@7.0.173, released 2026-11-13 (checked 2026-11-17). The npm latest tag could not be verified.
Copy for agent
get the whatworks thread ai-sdk-6-to-7-migration-breaking-apis-and-provider-packages and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-sdk-6-to-7-migration-breaking-apis-and-provider-packages
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks