unstale

npm / @ai-sdk/react

@ai-sdk/react

What changed in @ai-sdk/react 1 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

38 breaking10 deprecations19 new APIs and options1 performance7 behavior and defaults1 tooling23 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@ai-sdk/react 722 changes

Breaking changes 10

  • Top-level content, tool, file, source, and warning properties on generateText and streamText results now aggregate values across every step; use finalStep for final-step-only values.

    7.0.0upgrade guide

  • All packages are ESM-only; consumers using require() must switch to ESM import syntax.

    4.0.0, 7.0.0release notesupgrade guide

  • The deprecated option has been removed; replace remaining usages with activeTools.

    7.0.0upgrade guide

  • The deprecated function has been removed; replace usages with isToolUIPart.

    7.0.0upgrade guide

  • The deprecated tool-result content part type has been removed; use the file content part shape for inline file content.

    7.0.0upgrade guide

  • The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.

    4.0.0, 7.0.0release notesupgrade guide

  • The codemod updates named imports and direct re-exports while preserving local binding names and application export names as aliases; namespace member access remains unchanged.

    7.0.0upgrade guide

  • Approval policy can be configured on the generation call or agent instead of on individual tools.

    7.0.0upgrade guide

  • The deprecated type has been removed; use ToolExecutionOptions for imports and type references.

    7.0.0upgrade guide

  • generateText and streamText usage now totals tokens across all steps; use finalStep.usage for the former final-step-only value.

    7.0.0upgrade guide

Deprecations 7

  • Tool-result file content uses one canonical variant with tagged data and a required mediaType; legacy image-* and file-* variants are runtime-migrated.

    7.0.0upgrade guide

  • The user-message image content part is deprecated; use a file part with an image mediaType instead.

    7.0.0upgrade guide

  • The tool-level approval property is deprecated; move approval logic to the call or agent’s toolApproval setting so policy can vary by request.

    7.0.0upgrade guide

  • The per-step lifecycle callback is renamed from onStepFinish to onStepEnd for UI message stream helpers; onStepFinish remains a deprecated alias.

    7.0.0upgrade guide

  • Top-level final-step reasoning and metadata properties are deprecated; access them through finalStep instead.

    7.0.0upgrade guide

  • totalUsage is deprecated; use usage, which now contains usage across all steps.

    7.0.0upgrade guide

  • The streamText result method is deprecated; use the stateless top-level helper to compose the transformation over any stream.

    7.0.0upgrade guide

New APIs and options 2

  • Use finalStep to access final-step-only result values; for streamText, await finalStep before reading them.

    7.0.0upgrade guide

  • Models can return files in reasoning as a distinct content type; update exhaustive part handling and account for these files in content or reasoning rather than result.files or step.files.

    7.0.0upgrade guide

Behavior and default changes 2

  • The onEnd callback follows the result changes: usage and listed content properties cover all steps, while final-step-only properties are available on finalStep.

    7.0.0upgrade guide

  • Provider-specific reasoning settings take precedence over the top-level reasoning option when both are present, potentially bypassing that configuration.

    7.0.0upgrade guide

Tooling 1

  • Adds the migration skill to guide an agent through migrating from AI SDK v6 to v7.

    7.0.0upgrade guide

@ai-sdk/react 65 changes

Breaking changes 3

  • Use getStaticToolName to retrieve a tool name from static tool UI parts; getToolName has been renamed.

    6.0.0upgrade guide

  • Use isStaticToolUIPart to check for static tool UI parts; isToolUIPart has been renamed.

    6.0.0upgrade guide

  • The tool UI part state union adds approval-requested, approval-responded, and output-denied; update exhaustive state handling to cover them.

    6.0.0upgrade guide

Deprecations 2

  • getToolName now retrieves the name from either static or dynamic tool UI parts; the former getToolOrDynamicToolName name is deprecated but remains available.

    6.0.0upgrade guide

  • isToolUIPart now checks for either static or dynamic tool UI parts; the former isToolOrDynamicToolUIPart name is deprecated but remains available.

    6.0.0upgrade guide

@ai-sdk/react 446 changes

Breaking changes 15

  • addToolOutput now rejects continuous sessions.

    4.0.105release notes

  • Removes the deferred managed Responses coordinator and the autoContinueTools option.

    4.0.105release notes

  • Backend usage state is removed from the realtime runtime.

    4.0.105release notes

  • Live tool-result aliases are removed.

    4.0.105release notes

  • Realtime configuration now requires explicitly selecting relay transport mode.

    4.0.105release notes

  • sendTextMessage now rejects continuous sessions.

    4.0.105release notes

  • The callback argument no longer includes threadId or messageId; use those variables from the outer scope.

    4.0.0upgrade guide

  • The useChat method has been removed; use addToolResult instead.

    4.0.0upgrade guide

  • MCP App tool calls are rejected when allowedTools is omitted; explicitly list tools in handlers.allowedTools to expose them.

    4.0.0release notes

  • The experimental export has been removed; use the useAssistant hook directly.

    1.0.0, 4.0.0upgrade guiderelease notes

  • The setInput helper has been removed; use submit instead.

    4.0.0upgrade guide

  • The roundtrip options have been removed; use maxSteps instead. Its value is roundtrips + 1.

    4.0.0upgrade guide

  • The options parameter has been removed; set headers and body directly instead.

    4.0.0upgrade guide

  • The streamMode option has been removed; use streamProtocol instead.

    4.0.0upgrade guide

  • The streamMode option has been removed; use streamProtocol instead.

    4.0.0upgrade guide

Deprecations 1

  • keepLastMessageOnError now defaults to true and is deprecated; it will be removed in the next major release.

    4.0.0upgrade guide

New APIs and options 8

  • MCP App CSP metadata now supports baseUriDomains.

    4.0.174release notes

  • Adds experimental_queue to queue messages sent while a response is in progress.

    4.0.172release notes

  • An optional createTransport interface supports provider-owned realtime transports.

    4.0.167release notes

  • A provider connection capability supports provider-owned realtime transports.

    4.0.167release notes

  • Applications exchange WebRTC SDP through an application endpoint using api.session.

    4.0.105release notes

  • Experimental client-delegated Live conversations can use browser-direct WebRTC alongside WebSockets.

    4.0.105release notes

  • Adds realtime WebSocket sessions with lifecycle management, transcripts, context append, reversible capture, acknowledgements, and continuous PCM playback.

    4.0.105release notes

  • Adds a realtime hook returning UIMessage[], with onToolCall and addToolOutput for client-driven tool execution.

    4.0.0release notes

Performance 1

  • Unused realtime runtime code can now be tree-shaken, potentially reducing application bundle size.

    4.0.107release notes

Behavior and default changes 4

  • MCP Apps can load scripts and styles from origins declared in resourceDomains.

    4.0.174release notes

  • Default chat IDs are generated on first access, allowing useChat() to prerender without reading a random value when the ID is unused during rendering.

    4.0.147release notes

  • Live continuous sessions enforce 128 KiB frame and combined buffered-send budgets using actual encoded wire bytes.

    4.0.105release notes

  • Adds WebSocket relay support with shared session state, capture controls, bounded playback, graceful close, and application-handled Live delegation.

    4.0.105release notes

Fixes and other changes 17

  • Preserves replay semantics when using custom chat transports.

    4.0.141release notes

  • Prevents a second resume request on mount when an already submitted or streaming chat remounts with a shared Chat instance.

    2.0.277, 3.0.307, 4.0.141release notesrelease notesrelease notes

  • Prevents stale object streams from overwriting newer results.

    2.0.277, 3.0.306, 4.0.141release notesrelease notesrelease notes

  • Streamed chat updates no longer starve navigation transitions.

    4.0.130release notes

  • Automatic stream resumption is deduplicated for shared Chat instances, preventing duplicate resumption behavior.

    4.0.126release notes

  • Replacement completion requests remain loading and cancellable when an earlier request settles.

    4.0.112release notes

  • Prevents stale throttled completion updates from overwriting a newer request.

    4.0.112release notes

  • Preserves Headers instances in useCompletion requests.

    4.0.110release notes

  • Handles rejected asynchronous onFinish callbacks.

    4.0.110release notes

  • Preserves active cancellation state during overlapping requests.

    2.0.268, 3.0.293, 4.0.110release notesrelease notesrelease notes

  • Keeps useObject cleared when an initial value is configured.

    4.0.110release notes

  • Realtime session ownership and callbacks publish only after React commits, preserving connected sessions across abandoned renders and unmounting controls safely.

    4.0.105release notes

  • Omitted onToolCall remains undefined, preserving missing-tool-handler diagnostics; defined handlers returning undefined still support manual tool output.

    4.0.105release notes

  • maxPlaybackBufferSeconds is supported only for continuous PCM sessions.

    4.0.105release notes

  • Chats are aborted when their useChat id changes during a stream.

    4.0.101release notes

  • Fallback errors are surfaced for empty HTTP response bodies.

    4.0.95release notes

  • Preserves the generated useObject value when the API URL changes.

    4.0.69release notes

@ai-sdk/react 35 changes

Breaking changes 2

  • Use chat.addToolOutput() instead of chat.addToolResult() to add tool output.

    3.0.0release notes

  • React 19 release-candidate support is dropped, and minimum versions are required for RSC to address CVE-2025-55182.

    3.0.0release notes

New APIs and options 2

  • The useChat onFinish callback now includes finishReason.

    3.0.0release notes

  • Tool execution approval is now supported.

    3.0.0release notes

Fixes and other changes 1

  • The subscribeToMessages callback dependency in useChat is fixed.

    3.0.0release notes

@ai-sdk/react 215 changes

Breaking changes 2

  • Removes managed chat inputs, changing how applications provide chat input handling.

    2.0.0release notes

  • Removes the useAssistant hook; this is a breaking change.

    2.0.0release notes

New APIs and options 7

  • Adds a method to clear a chat error.

    2.0.0release notes

  • Introduces ChatStore as part of the new chat architecture.

    2.0.0release notes

  • Introduces ChatTransport as part of the new chat architecture.

    2.0.0release notes

  • UI messages support typed tool parts.

    2.0.0release notes

  • Adds a generic for UI messages.

    2.0.0release notes

  • Adds experimental throttle support back to useChat.

    2.0.0release notes

  • Adds a resume flag to useChat to support resuming an ongoing stream.

    2.0.0release notes

Behavior and default changes 1

Fixes and other changes 5

  • Nullish useChat IDs are treated like omitted IDs, preventing chat instance recreation on every render.

    2.0.275release notes

  • Uses structuredClone for messages in replaceMessage.

    2.0.0release notes

  • Fixes chat instance recreation in useChat.

    2.0.0release notes

  • Fixes message subscriptions becoming out of sync when the chat id changes after mount.

    2.0.0release notes

  • Integrates addToolResult into the UseChatHelpers type without an intersection.

    2.0.0release notes

@ai-sdk/react 16 changes

Breaking changes 6

  • The experimental_addToolResult API was removed.

    1.0.0release notes

  • Legacy function/tool calling was removed.

    1.0.0release notes

  • The default value of keepLastMessageOnError is now true.

    1.0.0release notes

  • Deprecated roundtrip options were removed from useChat.

    1.0.0release notes

  • The streamMode setting was removed from useChat and useCompletion.

    1.0.0release notes

  • The setInput helper was removed from useObject.

    1.0.0release notes