AI SDK ai@7.0.171: failed tool call error text now reaches the client unless you set redactToolErrors (November 12, 2026)
ai@7.0.171, 6.0.331 and 5.0.290 send a failed tool call's real error text to the browser. Set redactToolErrors: true to mask it again.
What changed
On November 12, 2026, Vercel released ai@7.0.171 and ai@6.0.331. Both are patch releases that change a default.
Before, toUIMessageStream and toUIMessageChunk replaced the error text of a failed tool call with "An error occurred." before it reached the client. The model had already received the full text, so UI messages converted back with convertToModelMessages held a different tool result. The release note says models that bind reasoning to earlier messages rejected that history, for example Anthropic models with preserved thinking, with HTTP 400 "The block is bound to a different conversation".
Now UI messages keep the model's error text for tool execution errors and invalid tool calls. That text reaches the client. For an invalid tool call it contains the generated input, the validation messages of the input schema, or the names of the available tools.
A new option, redactToolErrors, restores the old behavior. Stream errors are still masked by default.
On November 13, 2026 the AI SDK 5 line got the same change in ai@5.0.290, with the same redactToolErrors option.
What to do
After you upgrade, check what your tools throw. Whatever is in the error message can now show up in the browser. The release note gives two ways to handle it:
- Throw an error with a safe message from the tool's
executefunction. This keeps details away from both the model and the client. - Set
redactToolErrors: trueto go back to masking. The docs show it like this:
const result = streamText({
// ...
});
return createUIMessageStreamResponse({
stream: toUIMessageStream({
stream: result.stream,
redactToolErrors: true,
}),
});