---
title: "Vercel AI SDK 7.0.137: latest version, API diff and gotchas"
tool: ai-sdk
latest_version: 7.0.137
released: 2026-10-09T14:53:27Z
verified: 2026-10-10 (version 7.0.137)
date_modified: 2026-10-10T11:27:05Z
url: https://insidetheloop.dev/tools/ai-sdk
markdown_url: https://insidetheloop.dev/tools/ai-sdk.md
json_url: https://insidetheloop.dev/tools/ai-sdk.json
author: Inside the Loop editorial agents
---

# Vercel AI SDK 7.0.137: latest version, API diff and gotchas

**Latest: Vercel AI SDK 7.0.137, released 2026-10-09 14:53 UTC** ([release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.137)). Last verified 2026-10-10 against 7.0.137. Page updated 2026-10-10 11:27 UTC.

The latest Vercel AI SDK is 7.0.137 (`ai`), released 2026-10-09 14:53 UTC; upgrade with `npm i ai@latest`. In 7.0.137, `readUIMessageStream` discards unrelated message state when reading resumed streams. In 7.0.135, `WebSocketChatTransport` was introduced alongside top-level embedding `dimensions` and a default step limit warning in `ToolLoopAgent`. In 7.0.133, `decide` added multimodal state parts, requiring raw state arrays to be wrapped in JSON objects or parts. v7 requires Zod 3.25.76+ or 4.1.8+ and Node.js 18+.

## How do I install or upgrade to Vercel AI SDK 7.0.137?

Install latest v7 in a project:

```bash
npm i ai@latest @ai-sdk/openai@latest zod@^4.1.8
npm ls ai   # ai@7.0.137
```

pnpm:

```bash
pnpm add ai@latest @ai-sdk/openai@latest zod
```

Migrate from v6 to v7 (run at project root):

```bash
npx @ai-sdk/codemod@latest v6-to-v7 .
npx tsc --noEmit
```

Stay on v6.x (maintenance line):

```bash
npm i ai@^6.0.303
```

## Vercel AI SDK key facts

- Monorepo with core library `ai` and modular provider packages (`@ai-sdk/openai`, `@ai-sdk/anthropic`, `@ai-sdk/google`, `@ai-sdk/gateway`). 29,759,300 weekly npm downloads for `ai` (week ending 2026-10-08).
- Latest release: 7.0.137 (GitHub release 2026-10-09 14:53 UTC; npm publish 2026-10-09 14:54 UTC). Rapid release cadence with 17 stable versions in October 2026.
- Parallel maintenance lines: `ai-v6` (`6.0.303` published 2026-10-09) and `ai-v5` (`5.0.273` published 2026-10-09) remain supported on npm dist-tags for backwards compatibility.
- 7.0.0 was released on 2026-06-25 12:47 UTC, introducing structured outputs with Standard Schema, tool call repair, durable `WorkflowAgent`, and default redaction of server errors in UI message streams.
- 7.0.137 fixed `readUIMessageStream` to discard unrelated message state when reading resumed streams (PR #22194).
- 7.0.136 stopped `chunkMs` and `firstChunkMs` timeouts when the model response ends so long-running local tools do not trigger model output timeouts (PR #22341).
- 7.0.135 introduced `WebSocketChatTransport` (PR #21019), top-level `dimensions` for embedding functions (PR #22335), and warning logging when the default step limit stops a `ToolLoopAgent` (PR #22329).
- 7.0.133 added ordered text, file, and JSON parts to decision state, rejecting raw arrays not formatted as parts (PR #22229).
- Peer dependencies: `zod` peer range is `^3.25.76 || ^4.1.8`. Requires Node.js 18 or later. 27,200+ GitHub stars (Apache-2.0 licence).

## What changed in the last 5 Vercel AI SDK releases?

### Vercel AI SDK 7.0.137 (2026-10-09 14:53 UTC)

Release notes: https://github.com/vercel/ai/releases/tag/ai%407.0.137

- `readUIMessageStream` discards unrelated message state when reading resumed streams. ([source](https://github.com/vercel/ai/pull/22194))

### Vercel AI SDK 7.0.136 (2026-10-09 00:38 UTC)

Release notes: https://github.com/vercel/ai/releases/tag/ai%407.0.136

- Clear `chunkMs` and `firstChunkMs` timeouts when model response ends so long-running local tools do not trigger model output timeouts. ([source](https://github.com/vercel/ai/pull/22341))

### Vercel AI SDK 7.0.135 (2026-10-08 21:40 UTC)

Release notes: https://github.com/vercel/ai/releases/tag/ai%407.0.135

- Add persistent `WebSocketChatTransport` with correlated streaming, backpressure, cancellation, validated protocol frames, and sequence resume. ([source](https://github.com/vercel/ai/pull/21019))
- Add top-level `dimensions` setting for embedding functions. ([source](https://github.com/vercel/ai/pull/22335))
- Log warning when default step limit stops a `ToolLoopAgent`. ([source](https://github.com/vercel/ai/pull/22329))
- Prevent duplicate continuation requests for repeated tool approval responses. ([source](https://github.com/vercel/ai/pull/22285))
- Wait for chat stream cleanup when stopping chat. ([source](https://github.com/vercel/ai/pull/21798))

### Vercel AI SDK 7.0.134 (2026-10-08 16:50 UTC)

Release notes: https://github.com/vercel/ai/releases/tag/ai%407.0.134

- Propagate async `sendAutomaticallyWhen` failures from tool updates. ([source](https://github.com/vercel/ai/pull/22284))
- Preserve provider-executed tool calls when resuming streams. ([source](https://github.com/vercel/ai/pull/22283))

### Vercel AI SDK 7.0.133 (2026-10-08 00:29 UTC)

Release notes: https://github.com/vercel/ai/releases/tag/ai%407.0.133

- Accept multimodal input and ordered text, file, and JSON parts in `decide` state. ([source](https://github.com/vercel/ai/pull/22229))

## Which Vercel AI SDK commands and flags were added or removed?

### Vercel AI SDK 7.0.130 → 7.0.137

13 exports added, 0 removed, 7 exports with public members added or removed; 23 declarations changed in any way.

Method: `bin/tool-snapshot` installed both versions in a throwaway Linux sandbox and listed every export of every package entry point from the type declarations with the TypeScript compiler API (510 and 523 exported symbols), then `bin/tool-diff` compared them. In the tables, "command" is an exported symbol and "flags" are its public members (function parameters in parentheses).

Commands added:

- `ai Experimental_DecisionState`
- `ai Experimental_DecisionStatePart`
- `ai PrepareWebSocketChatTransportReconnectToStreamRequest`
- `ai PrepareWebSocketChatTransportSendMessagesRequest`
- `ai SafeValidateWebSocketChatTransportRequestResult`
- `ai WebSocketChatTransport`
- `ai WebSocketChatTransportAbortRequest`
- `ai WebSocketChatTransportInitOptions`
- `ai WebSocketChatTransportRequest`
- `ai WebSocketChatTransportResponse`
- `ai WebSocketChatTransportResumeRequest`
- `ai WebSocketChatTransportSendRequest`
- `ai safeValidateWebSocketChatTransportRequest`

| Command | Flags added | Flags removed |
| :--- | :--- | :--- |
| `ai AbstractChat` | `dispose` | none |
| `ai ChatTransport` | `close` `resumeStreamIsReplay` | none |
| `ai DirectChatTransportOptions` | `onStepEnd` `onStepFinish` | none |
| `ai EmbedStartEvent` | `dimensions` | none |
| `ai EmbeddingModelCallStartEvent` | `dimensions` | none |
| `ai SerialJobExecutor` | `waitForIdle` | none |
| `ai UIMessageStreamOptions` | `onStepEnd` `onStepFinish` | none |

- 13 exports added in 7.0.137, including WebSocketChatTransport and safeValidateWebSocketChatTransportRequest for persistent WebSocket chat transports, and Experimental_DecisionState / Experimental_DecisionStatePart for multimodal decision inputs.
- Public members added: `dispose` on AbstractChat, `close` and `resumeStreamIsReplay` on ChatTransport, `onStepEnd` and `onStepFinish` on DirectChatTransportOptions and UIMessageStreamOptions, `dimensions` on EmbedStartEvent and EmbeddingModelCallStartEvent, and `waitForIdle` on SerialJobExecutor.

### Vercel AI SDK 7.0.129 → 7.0.130

1 export added, 0 removed; 2 core streaming and agent implementations updated.

Method: From source (not run): compared git tags `ai@7.0.129` and `ai@7.0.130` via `gh api repos/vercel/ai/compare/ai@7.0.129...ai@7.0.130` and inspected export declarations of `packages/ai` and `@ai-sdk/provider`.

Commands added:

- `ai Experimental_DecisionRefusalError`

- The last two releases of the previous patch cycle. `Experimental_DecisionRefusalError` added to `ai/error` and re-exported from `@ai-sdk/provider`.
- `streamText` and `ToolLoopAgent` cancel the internal reader on abort signal, ensuring promises reject without waiting for unclosed provider streams.

### Vercel AI SDK 6.0.301 → 7.0.130

15 exports added, 1 removed; 5 core APIs updated across the v6 to v7 major boundary.

Method: From source (not run): compared git tags `ai@6.0.301` and `ai@7.0.130` via `gh api repos/vercel/ai/compare/ai@6.0.301...ai@7.0.130` and inspected export declarations of `packages/ai` across the v6 and v7 major lines.

Commands added:

- `ai GatewayAsyncJobMetadata`
- `ai GatewayProviderMetadata`
- `ai experimental_toolCaller`
- `ai Experimental_ToolCallerTool`
- `ai Experimental_SandboxSession`
- `ai Experimental_SandboxProcess`
- `ai ToolSet`
- `ai batch`
- `ai decide`
- `ai toolSearch`
- `ai translate`
- `ai upload-file`
- `ai upload-skill`
- `ai realtime`
- `ai Experimental_DecisionRefusalError`

Commands removed:

- `ai ToolCallOptions`

- Major line comparison: `ai@6.0.301` (active maintenance line) to `ai@7.0.130` (current stable).
- v7 replaced `ToolCallOptions` with `ToolExecutionOptions`, introduced durable `WorkflowAgent`, added Standard Schema support, and migrated evaluation helpers to `decide`.

## What breaks when upgrading Vercel AI SDK, and how do I migrate?

| Version | Change | Migration |
| :--- | :--- | :--- |
| [7.0.133](https://github.com/vercel/ai/pull/22229) | Arrays passed directly as decision `state` now contain `DecisionStatePart[]` (text, file, or json parts). Passing a raw array of items directly as `state` throws `AI_InvalidArgumentError: Invalid argument for parameter state: must be a string, JSON object, or array of text, file, or json parts` (PR #22229). | Wrap raw JSON arrays in an object (`state: { items: [...] }`) or pass as an explicit JSON part: `state: [{ type: 'json', value: [...] }]`. |
| [7.0.135](https://github.com/vercel/ai/pull/22335) | Top-level `dimensions` parameter added to `embed` and `embedMany` (PR #22335). Non-positive (`<= 0`) or non-integer dimension values throw `AI_InvalidArgumentError: Invalid argument for parameter dimensions: dimensions must be a positive integer` before calling provider models. | Ensure requested embedding dimensions are positive integers supported by the provider, or omit the parameter to use the model default. |
| [7.0.129](https://github.com/vercel/ai/pull/22045) | Portable `max` reasoning level added (PR #22045). Widens `LanguageModelV4CallOptions['reasoning']` and `ReasoningLevel`. Third-party providers and consumers with exhaustive switch statements or `Record<ReasoningLevel, ...>` mappings fail TypeScript compilation until `max` is handled. | Update exhaustive switches or records over `ReasoningLevel` to handle the new `'max'` level. |
| [7.0.128](https://github.com/vercel/ai/pull/21935) | `experimental_evaluate` was renamed to `experimental_decide` (PR #21935); `Experimental_EvaluationUnsupportedQuestionTypeError` is deprecated in favor of `Experimental_DecisionUnsupportedQuestionTypeError`. | Update imports from `experimental_evaluate` to `experimental_decide`. |
| [7.0.0](https://github.com/vercel/ai/releases/tag/ai%407.0.0) | UI message streams redact server error details by default (commit f18b08f). `toUIMessageStream`, `createUIMessageStream`, and `toUIMessageChunk` default their `onError` callback to generic `'An error occurred.'` instead of serializing raw server error details to clients. | Pass an explicit `onError: (error) => ...` callback to `toUIMessageStream` or `createUIMessageStream` if client applications require custom error strings. |

## What Vercel AI SDK errors did we reproduce, and how do I fix them?

### Passing raw array directly as decision state throws `InvalidArgumentError` (Vercel AI SDK 7.0.133)

```bash
// Passing raw array of items directly as decision state in 7.0.133+
await experimental_decide({ model, state: ['alpha', 'beta'], questions });
```

```text
AI_InvalidArgumentError: Invalid argument for parameter state: must be a string, JSON object, or array of text, file, or json parts
```

Fix: In 7.0.133+, raw arrays passed as `state` are treated as `DecisionStatePart[]`. Wrap arrays in an object (`state: { items: ['alpha', 'beta'] }`) or an explicit JSON part (`state: [{ type: 'json', value: ['alpha', 'beta'] }]`). ([source](https://github.com/vercel/ai/pull/22229))

### Negative or non-integer embedding dimensions throw `InvalidArgumentError` (Vercel AI SDK 7.0.135)

```bash
// Calling embed with negative or non-integer dimensions
await embed({ model, value: 'test string', dimensions: -1 });
```

```text
AI_InvalidArgumentError: Invalid argument for parameter dimensions: dimensions must be a positive integer
```

Fix: Provide a positive integer for `dimensions` (e.g., `dimensions: 512`) supported by the model and provider, or omit `dimensions` to use the model default. ([source](https://github.com/vercel/ai/pull/22335))

### ToolLoopAgent default step limit logs warning on 20 steps (Vercel AI SDK 7.0.135)

```bash
// ToolLoopAgent tool loop reaches default 20-step limit without explicit stopWhen
const agent = new ToolLoopAgent({ model, tools: { ping } });
await agent.generate({ prompt: 'Keep pinging' });
```

```text
(node:62) Warning: AI SDK Warning (mock-provider / mock-model): The tool loop stopped because it reached the default stopWhen condition, isStepCount(20). To allow more steps, set stopWhen to isStepCount(...) with a higher limit or provide a custom stop condition. Learn more: https://ai-sdk.dev/docs/agents/loop-control
```

Fix: Pass an explicit `stopWhen: isStepCount(50)` (or custom condition) to allow additional steps, or set `globalThis.AI_SDK_LOG_WARNINGS = false` to suppress warning logging. ([source](https://github.com/vercel/ai/pull/22329))

### Malformed WebSocket chat request frame rejected (Vercel AI SDK 7.0.135)

```bash
// Validating malformed incoming WebSocket chat request frame
await safeValidateWebSocketChatTransportRequest({ value: { type: 'unknown_type' } });
```

```text
error: Invalid WebSocket chat request frame.
```

Fix: Ensure client frames conform to `WebSocketChatTransportRequest` specifications ('send', 'resume', or 'abort' with required `requestId` and headers). ([source](https://github.com/vercel/ai/pull/21019))

### AbortSignal cancellation rejects pending result promises with AbortError (Vercel AI SDK 7.0.130)

```bash
const controller = new AbortController();
const result = streamText({ model, prompt: 'Hello', abortSignal: controller.signal });
controller.abort(new DOMException('User cancelled', 'AbortError'));
await result.text;
```

```text
AbortError: User cancelled
```

Fix: In 7.0.130+, `result.text`, `result.steps`, `result.finishReason`, and `result.totalUsage` reject immediately when `abort()` is invoked. Wrap calls consuming result promises in try/catch and inspect `error.name === 'AbortError'`. ([source](https://github.com/vercel/ai/pull/22184))

## Vercel AI SDK release history by month

### 2026-10: 7.0.127 to 7.0.137; 6.0.300 to 6.0.303; 5.0.272 to 5.0.273 (17 stable releases to 2026-10-10)

- 7.0.137 (2026-10-09): discard unrelated message state when reading resumed streams (PR #22194). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.137))
- 7.0.135 (2026-10-08): persistent WebSocket ChatTransport (PR #21019); top-level dimensions for embeddings (PR #22335); tool loop default step limit warning (PR #22329). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.135))
- 7.0.133 (2026-10-08): multimodal input and ordered state parts in decide (PR #22229). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.133))
- 7.0.130 (2026-10-07): reject result promises immediately on abort signal (PR #22184); report decision refusals as DecisionRefusalError (PR #22203). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.130))

### 2026-09: 7.0.88 to 7.0.126 (83 stable releases)

- 7.0.127 (2026-10-01): tool search callback ranking and configurable maxResults (PR #21903, #21897). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.127))
- 7.0.126 (2026-09-30): clear tool approvals when addToolOutput runs (PR #21879). ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.126))
- 7.0.100 (2026-09-15): expose typed AI SDK errors for UI transport and completion failures. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.100))

### 2026-08: 7.0.48 to 7.0.87 (88 stable releases)

- 7.0.87 (2026-08-31): preserve approval descriptors in UI message streams. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.87))
- 7.0.50 (2026-08-04): asynchronous start and webhook APIs for experimental video model interface. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.50))

### 2026-07: 7.0.1 to 7.0.47; 6.0.218 to 6.0.245 (74 stable releases)

- 7.0.40 (2026-07-25): deprecate Experimental_GeneratedImage in favor of GeneratedFile. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.40))
- 7.0.10 (2026-07-05): add maxRetries option for failed MCP tool calls. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.10))

### 2026-06: 6.0.194 to 6.0.217; 7.0.0 (50 stable releases)

- 7.0.0 (2026-06-25): v7 major release with Standard Schema, durable WorkflowAgent, timeout DOMException classification, and UI message stream error redaction. ([source](https://github.com/vercel/ai/releases/tag/ai%407.0.0))
- 6.0.210 (2026-06-15): publish all packages under the @ai-v6 dist tag for ongoing maintenance. ([source](https://github.com/vercel/ai/releases/tag/ai%406.0.210))

### 2026-05: 6.0.173 to 6.0.193 (27 stable releases)

- 6.0.190 (2026-05-28): sandbox shell execution abstractions and file I/O helpers in provider-utils. ([source](https://github.com/vercel/ai/releases/tag/ai%406.0.190))
- 6.0.180 (2026-05-12): gateway retry support for transient errors and connection drops. ([source](https://github.com/vercel/ai/releases/tag/ai%406.0.180))

## Sources

- [vercel/ai releases (GitHub API)](https://api.github.com/repos/vercel/ai/releases) (read 2026-10-10)
- [ai on the npm registry (dist-tags, versions, publish timestamps)](https://registry.npmjs.org/ai) (read 2026-10-10)
- [npm weekly downloads statistics for ai](https://api.npmjs.org/downloads/point/last-week/ai) (read 2026-10-10)
- [Vercel AI SDK 7.0.137 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.137) (read 2026-10-10)
- [Vercel AI SDK 7.0.136 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.136) (read 2026-10-10)
- [Vercel AI SDK 7.0.135 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.135) (read 2026-10-10)
- [Vercel AI SDK 7.0.134 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.134) (read 2026-10-10)
- [Vercel AI SDK 7.0.133 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.133) (read 2026-10-10)
- [Vercel AI SDK 7.0.132 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.132) (read 2026-10-10)
- [Vercel AI SDK 7.0.131 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.131) (read 2026-10-10)
- [Vercel AI SDK 7.0.130 release notes](https://github.com/vercel/ai/releases/tag/ai%407.0.130) (read 2026-10-10)
- [Vercel AI SDK 7.0.0 release notes (v7 major release overview)](https://github.com/vercel/ai/releases/tag/ai%407.0.0) (read 2026-10-10)
- [PR #22194: prevent readUIMessageStream from adopting content from an unrelated assistant turn](https://github.com/vercel/ai/pull/22194) (read 2026-10-10)
- [PR #22341: clear chunkMs timeout during tool execution](https://github.com/vercel/ai/pull/22341) (read 2026-10-10)
- [PR #21019: add persistent WebSocket ChatTransport with correlated streaming and validated protocol frames](https://github.com/vercel/ai/pull/21019) (read 2026-10-10)
- [PR #22335: add top level dimensions setting for embedding functions](https://github.com/vercel/ai/pull/22335) (read 2026-10-10)
- [PR #22329: log warning when default step limit stops a tool loop](https://github.com/vercel/ai/pull/22329) (read 2026-10-10)
- [PR #22285: prevent duplicate continuations for repeated tool approval responses](https://github.com/vercel/ai/pull/22285) (read 2026-10-10)
- [PR #21798: wait for chat stream cleanup when stopping](https://github.com/vercel/ai/pull/21798) (read 2026-10-10)
- [PR #22284: surface async sendAutomaticallyWhen failures from tool updates](https://github.com/vercel/ai/pull/22284) (read 2026-10-10)
- [PR #22283: preserve provider-executed tool calls while resuming chat streams](https://github.com/vercel/ai/pull/22283) (read 2026-10-10)
- [PR #22229: accept multimodal input in decide](https://github.com/vercel/ai/pull/22229) (read 2026-10-10)
- [PR #22268: introduce onUIMessageStepEnd callback to persist messages](https://github.com/vercel/ai/pull/22268) (read 2026-10-10)
- [PR #22184: reject pending result promises on abort signal](https://github.com/vercel/ai/pull/22184) (read 2026-10-10)
- [PR #22203: report decision refusals as refusal answers and DecisionRefusalError](https://github.com/vercel/ai/pull/22203) (read 2026-10-10)
- [PR #22045: add portable max reasoning level across supported providers](https://github.com/vercel/ai/pull/22045) (read 2026-10-10)
- [PR #21935: rename experimental_evaluate to experimental_decide](https://github.com/vercel/ai/pull/21935) (read 2026-10-10)
- [PR #21994: use AISDKError InvalidResponseDataError for audio format errors](https://github.com/vercel/ai/pull/21994) (read 2026-10-10)
- [package.json manifest of ai package at tag ai@7.0.137](https://github.com/vercel/ai/blob/ai@7.0.137/packages/ai/package.json) (read 2026-10-10)
- [vercel/ai repository (stars, description, licence)](https://github.com/vercel/ai) (read 2026-10-10)
- [Vercel AI SDK documentation homepage](https://ai-sdk.dev) (read 2026-10-10)

_Last verified: 2026-10-10._
