Packages

Vercel AI SDK v7.0.181 and @ai-sdk/xai v5.0.49: stoppedBy Loop Diagnostics, onWarning Hooks, and MCP Input Fixes

Vercel shipped ai@7.0.181 alongside @ai-sdk/xai@5.0.49 and @ai-sdk/gateway@4.0.154 on November 23, 2026. The updates add stoppedBy loop termination reasons, per-call onWarning hooks, and MCP tool-input preservation for TypeScript AI apps running on Node.js 22+.

By 0xScorPionSon

8 min read

Vercel AI SDK v7.0.181 and @ai-sdk/xai v5.0.49: stoppedBy Loop Diagnostics, onWarning Hooks, and MCP Input Fixes

Vercel AI SDK v7.0.181 TypeScript streaming and tool-loop architecture

Executive Summary

On November 23, 2026, Vercel published ai@7.0.181 alongside synchronized workspace releases including @ai-sdk/gateway@4.0.154, @ai-sdk/workflow@2.0.113, @ai-sdk/workflow-harness@1.0.192, @ai-sdk/vue@4.0.181, and @ai-sdk/xai@5.0.49 / 3.0.154 on GitHub Releases. Distributed on npm under the Apache 2.0 license with a strict Node.js 22+ (ESM-only) runtime floor, ai@7.0.181 focuses on agentic loop observability and MCP/tool-call fidelity rather than breaking API overhauls.

For TypeScript teams building streaming chat interfaces and multi-step tool loops, the release resolves two practical production blind spots: generateText and streamText now expose stoppedBy to report why a tool loop terminated, onWarning surfaces per-call and prompt-conversion warnings inline, and @ai-sdk/xai stops dropping mcpServer and xSearch arguments into empty objects (GitHub Releases).

Adoption Telemetry and Version Changelog

According to npm metadata updated November 24, 2026, and comparative ecosystem tracking by Upstash and Strapi, the ai package maintains a broad footprint in the JavaScript/TypeScript AI stack:

Package / Ecosystem Metric Verified Value Source
Latest Core Version ai@7.0.181 (Nov 23, 2026) GitHub Releases
Weekly npm Downloads (ai) 18,472,668 (~18.5M/wk, Oct 2026 snapshot) Upstash
npm Package Footprint 3 direct dependencies, 5,928 dependents, 1,675 versions npm (ai)
GitHub Stars (vercel/ai) 27,395 (Oct 2026 snapshot) Upstash
Minimum Runtime Floor Node.js 22+ (ESM-only; CommonJS dropped in v7) Strapi
License Apache 2.0 TanStack AI Docs
Provider Surface ~38–44 first-party provider packages (50+ community) TanStack AI Docs / Strapi

(Note: Upstash's October 19, 2026 snapshot and Strapi's 2026 guide report ~18.5M weekly downloads for ai compared to ~29M for openai, ~2.4M for langchain, and 553,088 for @tanstack/ai; current-day real-time weekly counts on npmjs.com were not returned in snippets.)

What Shipped on November 23, 2026

The November 23 release wave (verified via GitHub Releases and Releasebot) spans core loop diagnostics, xAI MCP tool-call preservation, and companion adapter bumps:

  • ai@7.0.181 (after ai@7.0.180 earlier the same day):
    • Per-call onWarning callback (d834c5b): Adds an onWarning callback at the call level and includes prompt-conversion warnings directly inside step warnings, preventing silent parameter drops when switching between providers.
    • stoppedBy termination metadata (7760e33): Adds stoppedBy to generateText and streamText results, the onEnd lifecycle hook, and the stream finish part so callers can distinguish whether a ToolLoopAgent or stopWhen rule halted execution versus the model finishing naturally.
    • Steering message delivery accounting (28d17e6): Reports why a run ended for steering messages sent after completion, and counts steering messages as delivered when prepareStep converts their text into message parts or attaches provider options.
    • Extraction telemetry cleanup (797dc02): Strips providerOptions from text and file parts in extraction telemetry while preserving arbitrary JSON state and the options actually transmitted to the upstream provider.
    • Gateway dependency bump (f2732a6): Updates @ai-sdk/gateway from 4.0.153 to 4.0.154 (which also gained headquarters-country provider filtering on November 23 per Releasebot).
  • @ai-sdk/xai@5.0.49 & @ai-sdk/xai@3.0.154:
    • mcpServer and xSearch input preservation (6f56c29, 61ce23e, b8cb0cd): Fixes a bug where mcpServer and xSearch tool calls returned an empty {} object in input, preserving the actual MCP and search arguments for logging, UI rendering, and replay.
  • Companion Framework & Harness Patches: @ai-sdk/workflow@2.0.113, @ai-sdk/workflow-harness@1.0.192, @ai-sdk/vue@4.0.181, @ai-sdk/svelte@5.0.180, @ai-sdk/rsc@3.0.180, @ai-sdk/tui@1.0.181, @ai-sdk/tool-web-fetch@1.0.30, and @ai-sdk/tool-bash@1.0.34 all shipped synchronized dependency updates on November 23.

Security Hygiene, Breaking Changes, and Internals

Security tracking via HVTracker (checked November 22, 2026 on 7.0.179) lists zero published advisories affecting the ai@7.x line. However, teams upgrading from v5/v6 or integrating v7.0.181 into production pipelines face four architectural and dependency boundaries:

  1. Node.js 22+ and Pure ESM (ai@7.x): Version 7 dropped CommonJS entirely and raised the runtime floor to Node.js 22 (following Node 20's April 2026 EOL noted in Strapi). Monorepos still compiling CommonJS ("module": "commonjs") or running older serverless Node runtimes cannot adopt 7.x without updating their build target.
  2. Deprecation of Vercel AI Elements (November 2026): According to Vercel's AI Elements documentation, the AI Elements frontend component project is scheduled for deprecation at the end of November 2026, prompting frontend teams to evaluate whether to vendor existing shadcn-based chat components or migrate to headless UI hooks.
  3. Telemetry Redaction & Provider Options (797dc02): Stripping providerOptions from text and file parts in extraction telemetry prevents provider-specific routing metadata or secret-adjacent headers from leaking into OpenTelemetry/trace spans while keeping runtime behavior intact.
  4. Loop Control, Steering, and Durable Execution: Vercel AI SDK recommends ToolLoopAgent with stopWhen (defaulting to stepCountIs(20) in v6/v7 migration docs) and toolApproval (replacing the deprecated needsApproval flag) for human-in-the-loop pauses, while WorkflowAgent / @ai-sdk/workflow handles durable execution across suspended runs (Strapi). With 7.0.181, stoppedBy and post-run steering delivery reporting (28d17e6) close the observability gap when prepareStep rewrites injected user steering messages mid-loop.
import { generateText, stepCountIs, tool } from 'ai';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';

const result = await generateText({
  model: openai('gpt-6.1-sol'),
  stopWhen: stepCountIs(5),
  onWarning: (warning) => {
    console.warn('[ai-sdk warning]', warning);
  },
  tools: {
    lookupStatus: tool({
      description: 'Check service health by ID',
      inputSchema: z.object({ serviceId: z.string() }),
      execute: async ({ serviceId }) => ({ serviceId, status: 'healthy' }),
    }),
  },
  prompt: 'Check health for billing-api and summarize.',
});

// New in ai@7.0.181: inspect exact loop termination reason
console.log({ text: result.text, stoppedBy: result.stoppedBy });

Ecosystem Comparison and Upgrade Checklist

TypeScript teams evaluating ai@7.0.181 in late 2026 typically compare it against TanStack AI (1.0), LangChain JS (1.x), and OpenAI Agents SDK (@openai/agents). Using verified specs from TanStack AI Docs, Upstash, and Strapi:

Capability Vercel AI SDK (ai@7.0.181) TanStack AI (1.0) LangChain JS (1.x)
License & Runtime Apache 2.0; Node 22+ (ESM-only) MIT; framework-agnostic TS MIT; Node 20.x–24.x
Wire Protocol Proprietary UI Message Stream (AG-UI via @ag-ui/vercel-ai-sdk) Native bidirectional AG-UI Custom streams (@ai-sdk/langchain bridge available)
Type Safety & Bundles Per-provider packages (~38–44) Per-model types; per-activity adapters Compositional (@langchain/core + providers)
MCP Client Support @ai-sdk/mcp (stable; Streamable HTTP / stdio; no server notifications yet) @tanstack/ai-mcp (multi-server pools, generated types, lazy tools) @langchain/mcp-adapters (MultiServerMCPClient)
Code Isolate Mode Experimental @ai-sdk/code-mode (QuickJS, Node 22+) 6 isolate drivers (Node, QuickJS WASM/Bun, Cloudflare, Daytona, E2B) Sandbox integrations
Durable Agent Runs Workflow SDK on Vercel (@ai-sdk/workflow) Detach, journal, takeover, reaper on any sandbox LangGraph.js checkpointers

Core API Mapping: Vercel AI SDK vs. TanStack AI

For teams weighing whether to stay on ai@7.0.181 or adopt TanStack AI 1.0 for a greenfield TypeScript app, TanStack AI's migration documentation maps the core primitives directly:

  • Model & Text Calls: streamText() / generateText() map to chat() / chat({ stream: false }), while generateObject() / Output.object() map to chat({ outputSchema }).
  • Middleware & Lifecycle: wrapLanguageModel(), onFinish, and prepareStep map to middleware: [...] with onFinish and onConfig.
  • Stream Serialization & React UI: result.toUIMessageStreamResponse() pairs with useChat from @ai-sdk/react (returning a 4-state status: submitted, streaming, ready, error), whereas TanStack AI uses toServerSentEventsResponse(stream) and fetchServerSentEvents('/api/chat') with native AG-UI events and built-in reconnection (Upstash).
  • Persistence & Resumable Streams: Vercel AI SDK leaves chat persistence as a custom pattern (saveChat / loadChat) and requires Redis plus resumable-stream routes for stream resumption, whereas TanStack AI bundles withPersistence middleware and automatic client reconnection (TanStack AI Docs).

Upgrade and Pinning Checklist for ai@7.0.181

  1. Verify Node.js & ESM Compatibility: Confirm all CI runners, Dockerfiles, and serverless functions target Node.js 22+ and pure ESM before bumping ai to ^7.0.181.
  2. Pin Synchronized @ai-sdk/* Packages: Always upgrade ai, @ai-sdk/gateway (4.0.154), @ai-sdk/workflow (2.0.113), and framework bindings (@ai-sdk/react, @ai-sdk/vue@4.0.181) together so UI Message Stream chunk types stay aligned.
  3. Adopt stoppedBy & onWarning in Observability: Wire result.stoppedBy into agent-loop alerting to catch silent stepCountIs() truncations, and log onWarning to surface unsupported provider parameters during model swaps.
  4. Update @ai-sdk/xai if Using MCP or xSearch: Upgrade to @ai-sdk/xai@5.0.49 (or 3.0.154 on v3) if your traces or approval UIs inspect mcpServer or xSearch tool inputs.
  5. Plan Around AI Elements Deprecation: Because Vercel's AI Elements project is scheduled for deprecation at the end of November 2026 (AI Elements Docs), audit any @ai-sdk UI components you depend on and vendor or replace them before locking in long-term frontend templates.

Frequently Asked Questions

What does stoppedBy return in ai@7.0.181?

stoppedBy is exposed on generateText and streamText results, the onEnd callback, and the stream finish part (7760e33), letting applications distinguish between a natural model stop and a stopWhen / step-count termination (GitHub Releases).

Can I use Vercel AI SDK v7 in a CommonJS project or on Node.js 20?

No. Version 7 dropped CommonJS support entirely and requires Node.js 22+ (following Node 20's April 2026 end-of-life) (Strapi). Projects pinned to Node 20 or CommonJS must stay on an earlier major branch or migrate to ESM on Node 22+.

What did @ai-sdk/xai@5.0.49 fix for MCP?

Prior to 5.0.49 (and 3.0.154), mcpServer and xSearch tool calls returned an empty {} object in their input field. The November 23 patch preserves the actual call arguments in input (GitHub Releases).

Should new TypeScript projects pick Vercel AI SDK or TanStack AI?

According to TanStack AI's own comparison, stay on or choose Vercel AI SDK when you want the largest adoption base (~18.5M weekly npm downloads, ~38–44 first-party providers) or already speak its UI Message Stream (@ai-sdk/react). Choose TanStack AI if you want native bidirectional AG-UI, per-model type narrowing, or built-in resumable streams without writing Redis persistence routes.

Are there any known security advisories in ai@7.0.181?

Security tracking on HVTracker (checked November 22, 2026 for 7.0.179) reports zero published advisories on the 7.x line, and 7.0.181 further hardens telemetry by stripping providerOptions from extraction spans (797dc02) (GitHub Releases).

Sources

  1. GitHub Releases — vercel/ai (ai@7.0.181, ai@7.0.180, @ai-sdk/xai@5.0.49, @ai-sdk/workflow@2.0.113, @ai-sdk/vue@4.0.181, published Nov 23, 2026): https://github.com/vercel/ai/releases
  2. npm — ai package (3 dependencies, 5,928 dependents, 1,675 versions, updated Nov 24, 2026): https://www.npmjs.com/package/ai
  3. TanStack AI Docs — TanStack AI vs Vercel AI SDK (Feature & protocol comparison for ai@7.x and TanStack AI 1.0): https://tanstack.com/ai/latest/docs/comparison/vercel-ai-sdk
  4. Releasebot — Vercel Release Notes (Nov 23, 2026): https://releasebot.io/updates/vercel
  5. Upstash — Vercel AI SDK vs TanStack AI: A Detailed Comparison (Oct 19, 2026): https://upstash.com/kb/vercel-ai-sdk-vs-tanstack-ai-comparing-type-safety-tools-streaming-and-performance
  6. Omid Saffari — Vercel AI SDK: What It Is, What It Costs, and How to Start (Nov 24, 2026): https://omidsaffari.com/blog/vercel-ai-sdk
  7. Strapi — LangChain vs Vercel AI SDK vs OpenAI SDK: 2026 Guide (Jan 29, 2026): https://strapi.io/blog/langchain-vs-vercel-ai-sdk-vs-openai-sdk-comparison-guide
  8. HVTracker — Vercel AI SDK Trust Score & Safety Signals (Nov 22, 2026): https://hvtracker.net/agents/vercel-ai-sdk/
  9. Vercel AI Elements Docs — The Vercel AI Frontend Stack (Deprecation notice for end of Nov 2026): https://elements.ai-sdk.dev/docs/vercel-ai-frontend

More on Packages

Packages

LiteLLM v1.111.0 and LTS 1.108.17: Rust /v1/messages Path, MCP DCR Opt-In, and Standalone UI Security Updates

LiteLLM shipped v1.111.0 alongside maintenance patches v1.110.4, v1.109.5, and v1.108.17 LTS on November 23–24, 2026. The updates introduce a native Rust /v1/messages execution path, opt-in MCP dynamic client registration, Gemini pass-through file ownership checks, and nginx 1.31.10 / zlib 1.4 upgrades for the standalone UI image, alongside breaking billing and RAG changes.

10 min read

Packages

openadapt-flow 4.0.0 & openadapt 1.24.0: Default HPKE Encryption at Rest, Fail-Closed Verdict Kernel, and Upgrade Guide

OpenAdaptAI released openadapt-flow 4.0.0, openadapt 1.24.0, openadapt-agent 2.2.4, openadapt-types 0.24.2, and OpenAdapt Desktop 0.33.1 on November 24, 2026. The major 4.0.0 bump enables sealed-set v3 HPKE encryption at rest by default for recordings, bundles, and run directories, introduces a unified fail-closed verdict kernel and zero-log 2FA handling, and tightens dependency floors. Here is what changed, what breaks on older launchers, and how to upgrade safely.

8 min read

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla