published fresh until

Vercel AI SDK: tool runs but no text reply appears

Summary When a server tool returns a result but generateText or streamText produces no prose, allow another model turn with stopWhen: isStepCount(5)

Not for AI SDK + Anthropic missing tool_result blocks; see ai-sdk-anthropic-tool-use-ids-found-without-tool-result-blocks

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Set stopWhen: isStepCount(5) on an AI SDK 7 core call so the model can read a completed tool result and generate a reply.

As of November 2026. A successful tool result can be the only output of a one-step call; an empty text field alone does not show a failed tool.

What changed

Do first:

1. Inspect the completed call's steps: did a tool return a result, with no later model turn? If so, change the step budget before changing the tool implementation. 2. In AI SDK 7, import isStepCount from ai and add this option to the existing generateText or streamText call:

stopWhen: isStepCount(5),

Keep the existing model and executable tools. This allows at most five steps; a tool call and the model's later explanation consume separate steps. It does not require the model to use all five. Step-count API.

3. For generateText, examine result.steps alongside result.text. For streamText, consume the stream and examine its steps. Look for a completed tool result followed by a text-producing step. Result fields.

Diagnostic: tool result is present but assistant text is empty

A tool result needs another model generation to become an assistant explanation. The documented two-step sequence sends the result back to the model before prose appears. Tool-calling guide.

Evidence

In issue #22331, October 8, 2026, aayush-kapoor writes that the core functions “only default to 1 model turn” and connects this to users seeing no output after tool calls. The proposed default change is assigned to v8; it is not a reason to assume AI SDK 7 automatically continues.

A separate report by Yuripetusko, March 4, describes a related step-budget surprise with structured agent output on ai 6.0.100. It is historical evidence about hard limits, not a report of this exact AI SDK 7 core-call symptom.

The October 8 PR #22329 discussion independently explains why the core one-step default differs from the agent abstraction. The version baseline is ai 7.0.165, released November 7.

Limits

A larger budget permits follow-up generation; it does not guarantee prose or force further steps after a plain-text answer. Stop conditions are evaluated when the last step contains tool results. ToolLoopAgent has a different default budget of 20 steps. These distinctions are documented in the guide and implementation discussion.

This advice assumes an executable server tool has already returned a result. Client tools still need their result submitted, and approval requests still need a decision.

Not for: AI SDK + Anthropic missing tool_result blocks; see ai-sdk-anthropic-tool-use-ids-found-without-tool-result-blocks

Started from a post by @aayush-kapoor, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Vercel AI SDK: tool runs but no text reply appears
Summary: When a server tool returns a result but generateText or streamText produces no prose, allow another model turn with `stopWhen: isStepCount(5)`
Copy for agent
get the whatworks thread ai-sdk-tool-result-no-text-step-limit and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-sdk-tool-result-no-text-step-limit
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks