@ai-sdk/provider
4.0.39 · 17 Nov 2026Apache-2.0108.8M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeLatest releases
All 109 releases- 4.x · latest line
4.0.39
17 Nov 2026Add extraction model support to provider registries, custom providers and string model ids
4.0.38
12 Nov 2026Prevent excessive memory and CPU usage when validating malformed UI messages.
validateUIMessages,safeValidateUIMessages, and the agent UI stream helpers reported the issues of every part schema for every invalid part, so a small request with many malformed parts could exhaust memory. Each part is now validated against the schemas for its type only, validation stops at the first invalid message or part, and an invalid JSON value in provider or tool metadata is reported as a single issue.Forward the provider's configured fetch transport when downloading file inputs. Add a
fetchoption tocreateDownloadso core downloads can also useguarded-fetchfor opt-in DNS validation on Node.js. The function returned bycreateDownloadcan now also be passed asexperimental_downloadtogenerateTextandstreamText, andexperimental_downloadnow also handles generated file URLs returned by the model, so one hook covers all core downloads. Document that the default URL checks do not resolve DNS and recommend the guarded transport or network egress controls for untrusted URLs.Keep Azure image and Vertex tool-result downloads separate from provider authentication wrappers so file hosts never receive Azure bearer tokens or Vertex Express Mode API keys.
Pass the call's abort signal to custom download requests, including prompt assets and generated files, so
experimental_download: createDownload({ fetch })preserves cancellation and timeouts.Add experimental extract api and extraction model spec
Patch Changes
Prevent excessive memory and CPU usage when validating malformed UI messages.
validateUIMessages,safeValidateUIMessages, and the agent UI stream helpers reported the issues of every part schema for every invalid part, so a small request with many malformed parts could exhaust memory. Each part is now validated against the schemas for its type only, validation stops at the first invalid message or part, and an invalid JSON value in provider or tool metadata is reported as a single issue.Forward the provider's configured fetch transport when downloading file inputs. Add a
fetchoption tocreateDownloadso core downloads can also useguarded-fetchfor opt-in DNS validation on Node.js. The function returned bycreateDownloadcan now also be passed asexperimental_downloadtogenerateTextandstreamText, andexperimental_downloadnow also handles generated file URLs returned by the model, so one hook covers all core downloads. Document that the default URL checks do not resolve DNS and recommend the guarded transport or network egress controls for untrusted URLs.Keep Azure image and Vertex tool-result downloads separate from provider authentication wrappers so file hosts never receive Azure bearer tokens or Vertex Express Mode API keys.
Pass the call's abort signal to custom download requests, including prompt assets and generated files, so
experimental_download: createDownload({ fetch })preserves cancellation and timeouts.Add experimental extract api and extraction model spec
Warn when a UI message stream sends a tool error text that differs from the text the model received and then sends reasoning from a later step. By default,
toUIMessageStreamsends "An error occurred." to the client for a failed tool call, while the model receives the full error text during a multi-step call. Converting the stored UI messages back withconvertToModelMessagesthen changes the tool result, and models that bind reasoning to the preceding messages (for example Anthropic models with preserved thinking) reject the request. The request still fails after this change; the warning and the updated documentation explain the cause and the available options.Send the error text of failed tool calls to the client as the model received it.
toUIMessageStreamandtoUIMessageChunkreplaced the error text of failed tool calls with "An error occurred." by default. The model had already received the full text during a multi-step call, so UI messages that were converted back withconvertToModelMessagescontained a different tool result. Models that bind reasoning to the preceding messages rejected that history (for example Anthropic models with preserved thinking, with HTTP 400 "The block is bound to a different conversation"), and other models continued from an error they never received.UI messages now keep the model's error text for tool execution errors and invalid tool calls. This text reaches the client. To keep details away from the model and the client, throw an error with a safe message from the tool's
executefunction. The error text of an invalid tool call contains the generated input, the validation messages of the input schema, or the names of the available tools;executedoes not run for it. To restore the previous behavior, set the newredactToolErrors: trueoption. A providedonErrorkeeps handling failed tool calls unless you setredactToolErrors: false. Stream errors are still masked by default.
4.0.37
7 Nov 2026Fix TypeSafe decision requests with primitive JSON state by serializing those values as text, reject empty criteria and null or undefined Score levels before sending a request, and expose structured Score legends in provider metadata. Allow omitted or null Box instructions and null Boolean criteria in experimental decision question types.
Dependency tracking
Know when your own dependencies move
@ai-sdk/provider shipped 2 new majors in the last 12 months, among 65 releases. inlinr shows which of your projects are behind, and what the upgrade breaks.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 18 Nov 2026. Releases and advisories last read 18 Nov 2026.