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
| Item | Verified official evidence |
|---|---|
npm package ai | As of November 2026, 7.0.181 (released 2026-11-23; checked 2026-11-24), listed in the official release and package manifest |
| Licence | Apache-2.0 (checked 2026-10-20), in that manifest |
| npm dist-tag | Registry fetch failed; latest was not independently verified |
| Runtime | Node.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
systemtoinstructions,fullStreamtostream,stepCountIstoisStepCount, andonFinishtoonEnd; removesexperimental_outputin favour ofoutput; 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
convertToModelMessagesasynchronous, 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 investigate | Likely migration boundary |
|---|---|
| CommonJS imports fail | ESM-only packages |
| Old exports no longer typecheck | Removed experimental names |
A consumer cannot find fullStream | Stream property rename |
| A tool-loop dashboard counts more calls/tokens | Results now accumulate across steps; decide whether it wants totals or final-step values |
| Old persisted chat fails before reaching the provider | System messages are rejected by default; move trusted instructions out of history |
| Traces disappear | OpenTelemetry 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