Vercel's AI SDK 7.1 Lets Developers Steer and Fix Agents Mid-Run
Vercel's AI SDK 7.1 ships mid-run steering, typed decisions, batch jobs, code mode, async video, and five new harness adapters for agent control at scale.
Takeaways
- AI SDK 7.1 ships with nine new feature categories centered on agent control and durability. Announcement
- HarnessAgent adds Cline, Cursor, fx, GitHub Copilot, and Grok Build adapters, plus mid-turn Codex steering.
- experimental_decide handles choice, score, boolean, and bounding-box questions in one typed call with probabilities.
- Code mode runs model-written JS/TS in a QuickJS sandbox to orchestrate tools outside the context window.
- New steer() and queue() APIs let users correct running generateText, streamText, and ToolLoopAgent runs.
- Fixed release cadence: monthly minors, one June major per year, 18 months of backported support.
Vercel has released AI SDK 7.1 notes. Building on version 7’s end-to-end agent primitives, the update adds controls for steering active runs, limiting tool concurrency, discovering tools on demand, recovering failed streams, processing deferred jobs, and tracing workflows across processes. Its nine feature areas address common failures in production agents: overloaded context windows, blocked requests, fragmented traces, and runs that need correction without a restart.
Harnesses share one contract
AI SDK 7 introduced HarnessAgent, a common API for coding-agent runtimes such as Claude Code, Codex, and Pi. A harness manages the agent’s sessions, event streams, tools, and usage data. Version 7.1 adds adapters for Cline, Cursor, fx, GitHub Copilot, and Grok Build.
Each adapter maps its runtime onto the same contract, allowing applications to change harnesses without rebuilding their integration layer.
The Codex adapter can also connect to the Codex app-server, allowing an application to send another user message while a turn is running. The message takes effect at a step boundary through the steering mechanism introduced across the SDK.
Shell, web, and tools on demand
Two first-party packages provide model-independent tools for common agent tasks. @ai-sdk/tool-bash runs shell commands inside a sandbox session supplied by the application. @ai-sdk/tool-web-fetch reads pages and documents while enforcing domain allowlists or blocklists. Both work with models that support tool calling.
Large tool catalogs no longer require every schema to occupy the prompt. The new toolSearch() function lets a model search for relevant tools during a run. Tools marked with deferLoading: true remain outside the initial context, and matching definitions become available on the next step.
Typed answers for routing logic
Agents routinely make bounded decisions such as assigning a support queue, scoring bug severity, or detecting a refund request. The new experimental_decide API submits several named questions about one shared state, then validates the answers against declared types.
The shared state can contain text, JSON, files, or a combination of those inputs. Supported question types include choices, scores, Booleans, and bounding boxes. Choice answers become a union of the option keys defined by the application, making them suitable for typed branching logic.
Boolean responses include the model’s estimated probability that the answer is true, so applications can apply their own routing thresholds. Providers with native decision-model support can also return probability distributions for choice and score responses.
Correct an agent between steps
AI SDK 7.1 exposes steering controls through generateText, streamText, and ToolLoopAgent. Applications can revise or extend a run without discarding completed work.
steer()inserts a user message at the next step boundary. A tool already running continues to completion.queue()holds a follow-up message until the agent finishes its current task.- An
idmakes message submission idempotent. Retrying with the same identifier returns the outcome of the original submission.
Defer jobs and stream media
- Batch processing:
experimental_startBatchsubmits text or image requests and returns a serializable reference that can be stored for later retrieval.experimental_getBatchStatuschecks progress, whileexperimental_getBatchResultsretrieves completed output. Supported providers include AI Gateway, Anthropic, Google, OpenAI, and xAI. - Streaming speech:
experimental_streamSpeechconverts incoming text to audio. It accepts a complete string or a text stream, including thetextStreamreturned bystreamText, allowing playback to begin before text generation finishes. - Asynchronous video:
experimental_startVideobegins video generation and immediately returns a serializable operation reference. Applications can poll its status or receive webhook callbacks. First-frame, last-frame, and reference-image inputs can anchor generation to existing assets.
streamSpeechTranslation adds live audio-to-audio translation, while streamTranscription produces live transcripts. The existing transcribe API can now return word-level and segment-level timestamps.
Have the model script tool calls
Tool schemas consume context even when the model never uses them, and intermediate tool results consume more context as a multi-step run progresses. Code mode reduces both costs by letting the model orchestrate several calls in generated code.
With @ai-sdk/code-mode, the model writes JavaScript or TypeScript that runs inside an isolated QuickJS sandbox. The generated program can call tools concurrently, combine their results, and filter large responses before returning data to the model. The experimental_toolCallers setting controls which tools generated code may invoke and which remain available as direct model tool calls.
Cap concurrency and repair streams
- Concurrency limits: AI SDK runs multiple tool calls from one step concurrently by default.
toolCallConcurrencylimits parallel execution when calls depend on shared state or ordered side effects. A value of1runs calls sequentially in model-generated order. - Per-step settings:
prepareStepcan overridetemperature,maxOutputTokens, andreasoningfor an individual step. - Mid-stream retries: The opt-in
streamRetriessetting reruns only the failed model step. Earlier steps, tool results, and output already emitted to the stream remain intact. - First-content timeout:
firstChunkMsaborts a step when a stream opens but produces no content within the configured interval. - Lower-memory streaming:
experimental_streamTextLowMemoryremoves the replay buffer for long, single-pass streams that do not require replay.
Keep one trace across processes
OpenTelemetry records an operation as a trace composed of spans for model calls, tools, and other work. A durable WorkflowAgent can suspend in one process and resume in another, which can fragment that trace. The new durable OpenTelemetry bridge joins those spans into one agent operation while preserving each span’s original timestamp.
WorkflowAgent also gains a non-streaming generate() method for callers that need a complete result rather than incremental output.
Put releases and support on a clock
Vercel has committed AI SDK to a fixed release and support schedule:
| Release or support phase | Schedule |
|---|---|
| Minor releases | The Monday closest to the first day of each month, excluding January and months with a major release. |
| Major releases | Once a year in June, replacing that month’s minor release. |
| Full support | One year for prior major versions, including backported bug fixes. |
| Security support | Six additional months for critical security fixes. |
- AI SDK 5 support ends at the end of 2026.
- AI SDK 6 support ends on June 1, 2027.
Install the current package with pnpm i ai. The AI SDK docs provide API details and examples. APIs whose names begin with experimental_ remain explicitly labeled experimental in version 7.1.