npm / @ai-sdk/provider-utils
@ai-sdk/provider-utils
What changed in @ai-sdk/provider-utils 3 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
4 breaking3 security19 new APIs and options1 performance6 behavior and defaults30 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/provider-utils 554 changes
Breaking changes 3
Arrays passed directly as state are interpreted as decision state parts; wrap JSON arrays in an object or a json part.
The API previously named evaluate is renamed to decide.
Packages are compiled for an ES2022 runtime target, which may affect runtime compatibility.
Security 2
Default Node.js downloads retain DNS validation and connection pinning when frameworks or instrumentation wrap global fetch before or after the SDK loads.
Prevents SSRF in OAuth metadata discovery.
New APIs and options 19
Adds the box decision question type with image bounds for TypeSafe AI.
Experimental decision state now supports ordered text, file, and JSON parts, and public state forms are normalized into parts before providers are called.
Image input is supported in OpenAI Decisions and language model adapters.
Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and ReasoningLevel; exhaustive consumers must handle max.
Experimental streaming lifecycle callbacks were added for speech generation and transcription.
Adds a shared structured language-model evaluation adapter for Choice, Score, and Boolean evaluations, preserving exact labels and metadata, validating score bounds, and returning prompted Boolean P(true) estimates validated to be in [0, 1].
Code-mode supports discovering and updating tools during a conversation.
Upload results now expose the file's byte size.
Upload results now expose the file's creation time.
Adds an optional file deletion operation to FilesV4.
Adds an optional streaming file download operation to FilesV4.
Upload results now expose the file's expiration time.
Adds abortSignal as a FilesV4 call option so calls can receive an abort signal.
Adds headers as a FilesV4 call option.
Adds a
{ type: 'stream' }variant for upload data.Adds an optional FilesV4 operation for retrieving file metadata.
Adds streaming multipart uploads with deterministic part ordering and failure-path stream teardown.
UI messages retain the approval request's reason separately from an approver's response reason.
Manual tool approval statuses can include a reason, which is preserved across core, model, and UI approval requests and surfaced for OPA requires-approval decisions.
Performance 1
Avoids excessive memory usage when base64 encoding byte arrays.
Behavior and default changes 6
Decision choice responses now accept exact criteria labels.
Decision file bytes are serialized as base64 in state attributes; model-call spans record normalized state parts, while outer spans retain public state inputs.
Bedrock Nova 2 maps portable xhigh to maxReasoningEffort: 'high' and returns a compatibility warning; Fireworks maps max to high and returns warnings for minimal, xhigh, and max in generation and streaming results.
Provider usage is propagated for speech generation and transcription telemetry.
Telemetry was added to speech generation and transcription.
Language-model evaluation adapters now default to reasoning: 'none' using each provider's existing reasoning mapping; explicit providerOptions reasoning settings still override it.
Fixes and other changes 23
URL paths and query values now retain case sensitivity.
Shared state is labeled in language-model decision prompts.
TypeSafe AI preserves native JSON state when state contains one JSON part.
Rows are limited to 64 MB during batch result downloads.
Parallel tool calls are preserved when stream labels are missing or reused.
Hostname parts are validated using isValidHostnamePart.
Use a standards-compliant User-Agent header.
Fixes streamed tool calls with missing, blank, or repeated IDs.
Prompt conversion preserves original opaque URI strings in tagged file URLs.
Prompt conversion matches supported URL MIME types exactly so unsupported subtypes are not forwarded to providers.
Keeps per-value multimodal content aligned across automatic batches, including text-only entries, and validates content length and provider options after middleware transforms.
Executes manually approved tool inputs produced by schema transforms, preserves approved inputs during revalidation, and rejects histories whose reconstructed output differs.
Audio detection now recognizes AAC audio with ADTS headers.
Image detection now handles AVIF and HEIC images with variable ftyp box sizes.
Following validated redirects no longer waits for response clone cancellation.
Makes the lazy Undici import visible to deployment tracers.
Avoids crashing when DOMException is not a global constructor.
Plain text prefixes are no longer detected as BMP or GIF images.
The core uploadFile() helper now forwards abortSignal to the provider call.
The core uploadFile() helper now forwards headers to the provider call.
Transient network errors while reading successful response bodies are now marked retryable.
Preserves schema-valued additional properties when converting Zod 4 schemas.
Fixes handling of empty string tool call IDs.
@ai-sdk/provider-utils 47 changes
Security 1
Adds opt-in URL validation and credential origin handling for URL-based image responses, including redirect validation, unsafe header stripping, and dropping credentials on cross-origin redirects; existing unvalidated requests are preserved.
Fixes and other changes 6
Preserves streamed tool calls when their IDs and indices are unreliable.
Matches full MIME types exactly when checking native URL support.
Preserves media types on file URLs in tool results.
Preserves approved inputs during revalidation, rejects histories whose reconstructed schema output differs, and validates transformed UI tool inputs against the reconstructed output.
OpenAI and Azure OpenAI embedding requests are split by a conservative UTF-8 byte budget derived from their aggregate token limit, in addition to input count limits.
Imports now work in runtimes without a global fetch function.
@ai-sdk/provider-utils 32 changes
Breaking changes 1
Stops re-exporting createTestServer and TestResponseController; import these APIs from @ai-sdk/test-server/with-vitest instead.
Fixes and other changes 1
Transient network errors while reading successful response bodies are now marked retryable, including for AI Gateway responses.