AI SDK 2.0.81 Released: Fixes toolChoice and Adds Interrupted Finish Reason

AI SDK workflow package 2.0.81 fixes toolChoice interception, adds an interrupted finish reason, and preserves custom parts.
The AI SDK's workflow package has released patch 2.0.81, a small version bump that nonetheless includes several changes affecting tool-calling and streaming response handling. First, it fixes the semantics of `toolChoice: 'none'`: the parameter is correctly forwarded to the Hugging Face Responses API, while in `generateText`, `streamText`, and `WorkflowAgent` tool calls are rejected locally before execution, streamed tool fragments are withheld, and repair hooks do not trigger. Second, it adds an `interrupted` finish reason for streams that end without a completion signal — the SDK preserves partial output without throwing on interruption and stops tool execution and agent continuation, though provider-side detection logic will be added separately. Because the new value enters the public finish-reason type, exhaustive switches or `Record` mappings may break CI due to type-checking failures. Additionally, `WorkflowAgent.stream()` now preserves custom content parts such as `openai.compaction`, and dependencies have been updated in sync.

The AI SDK's workflow package has released patch version 2.0.81. Despite the modest version bump, this update includes several changes that have a real impact on tool-calling behavior and streaming response handling — one of which may even cause type-checking errors in TypeScript projects after upgrading.
Fixing the Hard Constraint of toolChoice: 'none'
This update first addresses the semantics of toolChoice: 'none'. When calling the Hugging Face Responses API, the parameter is now correctly forwarded; meanwhile, within generateText, streamText, and WorkflowAgent, the SDK rejects tool calls directly at the local execution level before they run.
This change means that even if the model still returns tool-call intent, the SDK will intercept it locally and not proceed with execution. Streamed tool fragments are likewise withheld, so client-side tools cannot act on them. Additionally, the repairToolCall and experimental_refineToolInput hooks, typically used to repair tool calls, are not triggered on the rejection path. For applications relying on toolChoice: 'none' to guarantee plain-text output, this fix closes a potential bypass loophole.
toolChoice is a request parameter in the AI SDK that controls whether the model is allowed to initiate tool calls, with common values including 'auto', 'required', and 'none'. The intent of 'none' is to require the model to generate plain text only. But in the actual pipeline, the model may still slip tool-call intent into its output, so merely passing the parameter through at the request layer is not enough to guarantee the behavior — the SDK must add another interception before execution at the local level.
generateText, streamText, and WorkflowAgent are the three main text-generation paths in the SDK: the first two correspond to one-shot generation and streaming generation respectively, while the latter is used for agent workflows with step orchestration. repairToolCall and experimental_refineToolInput are repair hooks in the tool-call pipeline, used to attempt correction when parameters are invalid. This change explicitly specifies that these hooks will not run on the rejection path, meaning intercepted calls will not enter any subsequent processing stage.
Adding the interrupted Finish Reason
The second change introduces a new finish reason, interrupted, for provider streams that end without receiving a completion signal. The SDK preserves the partial output already produced and does not throw an error merely because of the interruption. At the same time, tool execution, agent continuation, and automatic UI follow-up actions all stop, and late-arriving tool results and approval requests are ignored.
Note that the provider-side detection and emission logic will be added separately, so the current version is more of an SDK-level preparation.
The release notes specifically include a compatibility warning: because interrupted is added to the public finish-reason type, even a patch version may break type checking after upgrading. Code using exhaustive switches (e.g., with an assertNever fallback) or mappings like Record<FinishReason, string> must handle this new value. Custom validation logic or application code that assumes the existing set of finish reasons is closed will also need to be updated.
For applications that need to detect incomplete responses, it is recommended to additionally check finishReason === 'interrupted' beyond existing error handling.
Finish reason is the SDK's classification of how a model response ended, with typical values including stop (natural end), length (reached the length limit), and tool-calls (ended with a tool call). Many TypeScript projects handle it exhaustively — using a switch to cover all members, with an assertNever-style fallback to ensure nothing is missed.
Adding a member to a public type is a source-compatibility break: the existing code itself is unchanged, but type checking will fail because the new branch is not covered. Mappings like Record<FinishReason, string> that require all keys to be covered are also affected. So even for a patch version, CI that relies on strict type checking may fail after upgrading, and the handling logic must be completed in sync before upgrading.
Preserving Custom Content Parts
The third change concerns the step results of WorkflowAgent.stream() and subsequent model requests. Custom content parts like openai.compaction are now preserved rather than lost between steps. This is a practical fix for agent workflows that rely on vendor-specific parts to carry context or control information.
This release also updates dependencies, including ai@7.0.149, @ai-sdk/provider@4.0.32, and @ai-sdk/provider-utils@5.0.66.
Upgrade Recommendations
For most projects, 2.0.81 is a patch worth following. Before upgrading, however, it is recommended to search globally for exhaustive finish-reason handling logic and confirm that the new interrupted value is covered, to avoid unexpected type-checking failures in CI. If your application relies heavily on the local interception behavior of toolChoice: 'none', this fix is also worth verifying separately.
Related articles

Free Unlimited Claude Code Solution: Agnes AI + CC Switch Setup Guide
No paid subscription needed — pair the free AI platform Agnes AI with the open-source tool CC Switch to provide a backend for Claude Code, enabling unlimited free calls to text, image, and video models. This guide covers the full setup, test results, and usage boundaries.

A Complete Zero-Cost Guide to Getting Started with Claude Code for Beginners in China
A beginner's guide to Claude Code for users in China: two installation methods (command line and IDE plugin), full configuration steps for replacing the official API with the free domestic LongCat model, and a hands-on demo of building a small tool with natural language, plus tips.

When the NSA Gets Involved: The AI Supply Chain Crisis Behind Open-Source CVEs and API Key Hijacking
Multiple open-source projects disclosed severe CVEs in one day, PHP flaws alarmed the FBI, and Railway and OpenCode were breached with API keys stolen. This article breaks down the vulnerability window, AI-accelerated exploitation, and the AI supply chain crisis behind the API key black market, with a developer defense checklist.