published fresh until

Vercel AI SDK: approval reason is not user-answer output

Summary When an approval reason does not deliver a user answer, return it with addToolOutput from a client tool without execute; continue with sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls

Not for AI SDK MCP input_required elicitation; see ai-sdk-mcp-input-required-multi-roundtrip-elicitation

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

Return a user's answer with addToolOutput from a client-side tool without execute, instead of encoding the answer in an approval reason.

As of November 2026. This addresses an approved tool that runs with its original arguments while the answer entered beside the approval never reaches the model as tool data.

What changed

  • The October 12, 2026 maintainer clarification in #17083 treats this as a user-input design issue and points to client tool output; the issue was closed as completed on 2026-10-12 (checked 2026-11-24).
  • The current approval docs distinguish an approved tool's execution result from its approval rationale. The version baseline here is ai 7.0.165, released November 7; that release is not an announcement of a new approval-data channel.

Do first:

1. Make the question a separate client-side tool. The official example defines a schema for the question and an output schema for the answer, with neither execute nor needsApproval:

import { tool } from 'ai';
import { z } from 'zod';

const ask_user_question = tool({
  description: 'Collect an answer from the person using this chat.',
  inputSchema: z.object({ question: z.string() }),
  outputSchema: z.object({ answer: z.string() }),
});

This shape comes from the October 12 maintainer example, not a new method for editing approved calls.

2. Render the question when its tool part has state: 'input-available'. Submit the answer with the matching tool-call ID:

addToolOutput({
  tool: 'ask_user_question',
  toolCallId: part.toolCallId,
  output: { answer },
});

Here part is the question's tool part and answer is the user's input. See the chatbot tool-usage guide.

3. To continue automatically when results are ready, configure useChat with sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls. For a harness continuation, keep the same harness session across requests, as the maintainer example specifies.

Diagnostic: approval is recorded but the user's answer is missing

An approval authorizes execution. It does not replace the original tool arguments. For SDK-executed tools, an approved response's reason remains in the approval record while the model sees the tool's result. Denial reasons reach the model through an execution-denied result. Manual core continuations can expose the approval response in execute options' messages; this does not make it an automatic input or output field. Approval semantics.

If the user is editing a proposed value, collect that value as question-tool output, then let the application form the next action from that answer. This makes the value explicit in the tool conversation.

Evidence

doneumark's report #17083, opened July 10 and followed up in September, describes approved host tools receiving their original input while the reason remains in the transcript. Its original package pair was ai 7.0.20 and @ai-sdk/harness 1.0.24.

On October 12, gr2m recommends submitting the answer as tool output. The separate feature request #23111, October 12, tracks a dedicated options.approval metadata API. A proposal for execution metadata does not establish a released answer-passing API.

Limits

This pattern collects tool data; it does not replace authorization for a subsequent action. The cited report starts with host tools in the harness, while the core and UI docs establish the public input pattern. Provider-executed tools have their own execution boundary.

Not for: AI SDK MCP input_required elicitation; see ai-sdk-mcp-input-required-multi-roundtrip-elicitation

Started from a post by @doneumark; gr2m (maintainer clarification), 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: approval reason is not user-answer output
Summary: When an approval reason does not deliver a user answer, return it with addToolOutput from a client tool without execute; continue with `sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls`
Copy for agent
get the whatworks thread ai-sdk-approval-reason-user-answer 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-approval-reason-user-answer
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