vercel/ai · error · Error

Tool approval was requested, but the renderer does not suppo

Error message

Tool approval was requested, but the renderer does not support tool approval input.

What it means

During run(), if the agent's response message contains pending tool approval requests, the runner requires a renderer that implements readToolApproval to ask the user. If the renderer lacks that capability, it throws this error instead of silently approving or denying a tool.

Source

Thrown at packages/tui/src/agent-tui-runner.ts:177

      try {
        const responseMessage = await this.renderer.renderStream(result, {
          title,
          submittedPrompt: prompt,
          continueSession: Boolean(this.renderer.readPrompt),
          tools: this.tools,
          reasoning: this.reasoning,
          responseStatistics: this.responseStatistics,
          contextSize: this.contextSize,
          waitForExit: false,
        });

        if (responseMessage && responseMessage.parts.length > 0) {
          const approvalRequests =
            findPendingToolApprovalRequests(responseMessage);

          if (approvalRequests.length > 0) {
            if (!this.renderer.readToolApproval) {
              throw new Error(
                'Tool approval was requested, but the renderer does not support tool approval input.',
              );
            }

            for (const request of approvalRequests) {
              const response = await this.renderer.readToolApproval(request, {
                title,
              });
              applyToolApprovalResponse(responseMessage, request, response);
            }

            upsertResponseMessage(
              messages,
              responseMessage,
              streamWithoutPrompt,
            );
            streamWithoutPrompt = true;
            prompt = undefined;

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Use a renderer that implements readToolApproval.
  2. Provide an approval handler, or configure tools to not require approval.
  3. Pre-check renderer.readToolApproval before running tools with approval requirements.
  4. Auto-approve explicitly if running unattended (accepting the risk).

Example fix

// before
const renderer = { readPrompt: async () => 'hi' };
// after
const renderer = {
  readPrompt: async () => 'hi',
  readToolApproval: async request => ({
    approvalId: request.approvalId,
    approved: true,
  }),
};
Defensive patterns

Strategy: validation

Validate before calling

if (!renderer.readToolApproval) {
  throw new Error('Renderer must implement readToolApproval for approval-required tools.');
}

Type guard

null

Try / catch

try {
  await runner.run();
} catch (error) {
  if (error.message.includes('does not support tool approval')) {
    // switch renderer or disable approval-required tools
  } else throw error;
}

Prevention

When it happens

Trigger: An agent turn requests tool approval (e.g. a tool with needApproval) while the active TUI renderer does not implement readToolApproval.

Common situations: Using a headless/non-interactive renderer with tools that require approval; forgetting to wire an approval handler in a custom renderer; adding approval-required tools after choosing a minimal renderer.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/d5eee43fcc9340f8. Report an issue: GitHub.