Dev & EngARTICLE

7 min read

AI SDK 7.1 brings AI agent control into the front-end app

AI SDK 7.1 brings AI agent control into the front-end app
Image: Carina Ferreira
Article · Dev & Eng
Reading
7 min
Tables
1
Code
3
In short

Vercel's AI SDK update moves controls into the front-end that used to live only in the backend: correcting a running agent, recovering from an error mid-stream, and tracing a workflow that spans multiple processes in a single trace.

A atualização do AI SDK da Vercel leva para o front-end controles que antes viviam só no backend: corrigir um agente em execução, recuperar erro no meio do stream e rastrear um workflow que atravessa vários processos num único trace.

From server-side automation to the user's app

Vercel announced AI SDK 7.1, an update to the ai package that has become the de facto standard for integrating LLMs into React, Next.js, and Node.js applications. Version 7 provided the basic building blocks for constructing agents end to end: ToolLoopAgent, HarnessAgent, and the tool-calling infrastructure. 7.1 tackles a different problem: what to do when that agent is already running, in production, for minutes or hours, and something needs to change midway through.

This matters because this kind of control historically lived in the backend: orchestrators like Temporal, job queues, and distributed tracing systems handled steering, error recovery, and workflow observability far from the interface. AI SDK 7.1 brings these three things into the layer the front-end already uses every day: useChat, streamText, ToolLoopAgent. Who needs to implement and test this behavior changes: instead of a platform team, it becomes the dev writing the chat component.

Release cadence becomes predictable

Before getting into the features, it's worth noting a structural change: AI SDK now follows a fixed calendar. Minor releases ship on the Monday closest to the 1st of each month (except January), and a major release replaces the June minor once a year.

Expert views

What people are saying about it.

Since December 3, 2026, it has been possible to create repositories on GitHub using SHA-256 instead of SHA-1. The algorithm has existed in Git since 2020, but it's only now arriving on github.com, with no conversion for existing repositories.

Bisneto Bragain an iMasters article · Read the article: GitHub Enables Creation of Git Repositories with SHA-256 in Public Preview

A test published on Planet PostgreSQL shows that REPACK (CONCURRENTLY) allows reading and writing during most of a table's reorganization. But there is a final moment when the lock returns, and it can take longer than it seems.

Roberto Dinizin an iMasters article · Read the article: PostgreSQL 19: REPACK (CONCURRENTLY) shrinks tables without blocking reads, but locks at the end
VersionFull supportCritical fixes only
AI SDK 5until the end of 2026-
AI SDK 6until June 1, 2027plus 6 months after that
AI SDK 71 year from releaseplus 6 months after that

For teams maintaining products in production, this gives a concrete planning window: teams still on AI SDK 5 have until the end of this year before losing patches, and those on 6 have until June 2027. It makes it easier to decide when to migrate instead of scrambling after a surprise breaking change.

Steering: correcting the agent without waiting for it to finish

This is the feature that most affects everyday UI. Up through version 7, if the user noticed a misinterpretation mid-turn (the agent searching the weather for Paris, France, when they meant Paris, Texas), the only options were to wait for the turn to finish or abort the entire job and start over.

experimental_createSteering() creates an object that can be passed as experimental_steering to generateText, streamText, or ToolLoopAgent. Two methods do the work:

  • steer() injects a correction message at the next step boundary, without interrupting a tool call in progress.
  • queue() holds a follow-up message until the agent finishes the current task.
ts
const steering = experimental_createSteering();

const result = streamText({
  model: 'openai/gpt-6.2-astra',
  tools: { weather },
  experimental_steering: steering,
  prompt: 'What is the weather in Paris?',
});

await steering.steer('Actually, I meant Paris, Texas.');

The return value of steer() and queue() indicates whether the message was actually delivered, and accepts an id to make retries safe: resending with the same id returns the result of the first send. In useChat, these corrections arrive as steering-message parts inside the assistant message, so the history stays complete without extra rendering work.

The same mechanism reached the Codex adapter: HarnessAgent connects to Codex's app-server and allows experimental_steer() on a turn that's already running, not just on the SDK's native agents.

WebSocket replaces request-response in chat

useChat always relied on a configurable ChatTransport, but until now the de facto standard was one HTTP request per turn. The new WebSocketChatTransport keeps a persistent connection, with support for cancellation and resumption based on message sequencing.

tsx
const transport = useMemo(
  () => new WebSocketChatTransport({ url: '/api/chat' }),
  [],
);
const { messages, sendMessage, stop } = useChat({ transport });

For a simple question-and-answer chat, this is unnecessary complexity: HTTP streaming works well and doesn't require keeping a live connection on the server. The gain shows up in long-running agents with active steering, where reopening an HTTP request for every user correction costs more (and takes longer for the user to notice) than sending the message through the already-open socket.

Voice and realtime stop being single-turn

Experimental realtime support in version 7 covered turn-by-turn voice sessions: one question, one answer, disconnect. 7.1 generalizes this on two fronts.

First, speech generation, transcription, and translation become streaming: experimental_streamSpeech accepts the textStream straight from a streamText and starts speaking before the text finishes being generated, which reduces perceived latency in voice interfaces. streamTranscription and streamSpeechTranslation do the equivalent for input audio.

Second, the connection itself becomes more flexible. Beyond the original turn-by-turn model, there are now continuous conversations via WebSocket or WebRTC, server-opened connections (instead of a short-lived token straight in the browser), and provider-managed transports. The useRealtime hook, from the @ai-sdk/react package, exposes this with the same signature:

tsx
const realtime = useRealtime({
  model: openai.experimental_realtime('gpt-live-1'),
  api: { websocket: 'wss://your-app.example/live' },
  sessionConfig,
});

For continuous voice products, the server-opened connection option matters because it removes token security responsibility from the browser and allows moderating the session on the backend before the audio goes out.

A single trace for workflows that cross processes

This is the most "backend" piece of the release, but it changes what the front-end needs to instrument to debug an agent in production. WorkflowAgent.generate() runs a durable agent, whose run can survive restarts, queues, and multiple processes, and emits a single OpenTelemetry trace per execution, even when that execution spans several machines.

Before, tracing an agent like this meant manually stitching together spans scattered across different services. With the unified trace, the team building the chat UI gets a single point to plug in observability (Honeycomb, Datadog, whatever's already in the pipeline) and tie what the user saw on screen to the exact step where the agent got stuck or became expensive.

Error recovery mid-stream

Along with steering, 7.1 adds a set of controls for error handling and concurrency in generateText, streamText, and ToolLoopAgent:

  • Per-step error callbacks, to react to a step failure without bringing down the entire stream.
  • First-content timeout, which detects a stuck model before the user gives up waiting.
  • Automatic stream retries, to reconnect without losing progress already generated.
  • Tool call concurrency and per-step settings, to tune cost and latency tool by tool instead of for the whole call.
  • Low-memory streaming, for long runs that previously accumulated too much buffer.

In practice, this removes the dev's obligation to hand-reimplement retry and UI fallback every time a tool fails midway through a multi-step agent: the SDK exposes the right hook instead of letting the whole stream drop.

The rest of the package: harnesses, code mode, decisions, and batch

The release also expands the harness catalog: HarnessAgent gains adapters for Cline, Cursor, fx, GitHub Copilot, and Grok Build, in addition to the existing ones for Claude Code, Codex, and Pi, all normalized under the same interface. First-party tools for bash (@ai-sdk/tool-bash) and web search (@ai-sdk/tool-web-fetch) work with any model that supports tool calling, and the new toolSearch() lets you mark tools with deferLoading: true so the model discovers what it needs instead of loading the whole catalog into the prompt.

Code mode (@ai-sdk/code-mode) lets the model write JavaScript or TypeScript that calls tools inside an isolated QuickJS sandbox, useful when there are many tools and orchestrating them step by step costs too much context. experimental_decide resolves classification questions (choice, score, boolean, bounding box) about the same state in a single call, with typed responses. Batch processing (experimental_startBatch) sends text and image generation to run in the background, and asynchronous video generation (experimental_startVideo) avoids keeping a call open for minutes.

Where this still isn't worth it

Almost everything listed here carries the experimental_ prefix, and that's not a minor detail: Vercel has historically promoted these APIs to stable only after cycles of real-world use, changing the signature along the way. It's worth testing steering and WebSocketChatTransport behind a flag, not swapping the entire production base in the first week.

For simple question-and-answer chat, without long-running tasks, the complexity of WebSocket, steering, and distributed tracing doesn't pay off. The gain only shows up when the agent runs long enough for the user to want to interrupt or correct it midway. In those cases, the HTTP streaming that already existed in version 7 remains the simplest and easiest-to-debug choice.

Translated from the Brazilian Portuguese original · Read the original

Read also
Dev & Eng

Vercel CDN gets cache bypass rules controlled by frameworks

Vercel has opened up, via the Build Output API, a mechanism that lets frameworks define when to bypass edge cache based on request and response headers. Next.js 16.5 already uses this to stop reloading entire pages every time a bot like Bingbot crawls them.

Carina Ferreira··1 min