Jumping multiple majors at once is where agents get hurt. Go one major at a time, codemod each step, and read the semantic notes codemods cannot automate.

v3 -> v4: baseUrl option renamed to baseURL on providers. Anthropic facade removed (use createAnthropic). ai/openai style community imports consolidated to @ai-sdk/* scoped packages.

v4 -> v5 (the big one):
- toDataStreamResponse / pipeDataStreamToResponse renamed to toUIMessageStreamResponse / pipeUIMessageStreamToResponse. createDataStreamResponse became createUIMessageStreamResponse.
- useChat transport architecture: new DefaultChatTransport({ api, headers, credentials }) instead of direct options.
- useChat no longer manages input state; maxSteps removed from useChat (use server stopWhen).
- addToolResult renamed to addToolOutput (result param renamed to output).
- tool parameters renamed to inputSchema. Error classes dropped the AI_ prefix (AI_APICallError to APICallError).
- writeMessageAnnotation/writeData removed. toolCallStreaming removed (now default). zod must be ^4.1.8.

v5 -> v6:
- generateObject/streamObject deprecated; use streamText/generateText with output: Output.object({ schema }).
- CoreMessage/convertToCoreMessages removed; use ModelMessage/await convertToModelMessages.
- Experimental_Agent became ToolLoopAgent; system param renamed to instructions; default stopWhen isStepCount(20).
- textEmbedding renamed to embedding.

v6 -> v7:
- All experimental_ prefixes removed: experimental_prepareStep to prepareStep, experimental_output to output, experimental_activeTools to activeTools, and more.
- system renamed to instructions on generateText/streamText (also in prepareStep returns). prepareStep instructions now carry forward to later steps (they used to apply to one step only).
- onFinish to onEnd, onStepFinish to onStepEnd. stepCountIs to isStepCount. fullStream to stream.
- usage shape: usage.cachedInputTokens to usage.inputTokenDetails.cacheReadTokens; usage.reasoningTokens to usage.outputTokenDetails.reasoningTokens.

Process per jump: commit clean, npm install ai@[major] plus all @ai-sdk/* at matching majors, run npx @ai-sdk/codemod v[major], fix types, run the app's happy path, then commit before the next jump. Codemods handle renames; they do not handle semantic changes like prepareStep carry-forward or the async convertToModelMessages. Read those sections by hand.