vercel/ai · error · Error

No prompt was provided and the renderer does not support…

Error message

No prompt was provided and the renderer does not support prompt input.

What it means

AgentTUIRunner.run needs a prompt to execute a turn. If no prompt argument was given, it falls back to the renderer's readPrompt() for interactive input; if the renderer has no readPrompt support either, it throws. If a turn already ran (hasRunTurn), it returns silently instead of throwing.

Solutions

  1. Pass a prompt string to run().
  2. Use a renderer that implements readPrompt for interactive input.
  3. Check this.renderer.readPrompt support before running without a prompt.
  4. If input comes from elsewhere, supply it explicitly rather than relying on the renderer.

Example fix

// before
await runner.run();
// after
await runner.run({ prompt: 'fix the failing test' });
Defensive patterns

Strategy: validation

Validate before calling

if (prompt == null && !renderer.readPrompt) {
  throw new Error('Provide a prompt or use a renderer that implements readPrompt.');
}

Type guard

null

Try / catch

try {
  await runner.run(opts);
} catch (error) {
  if (error.message.includes('does not support prompt input')) {
    await runner.run({ ...opts, prompt: fallbackPrompt });
  } else throw error;
}

Prevention

When it happens

Trigger: Calling run() without a prompt on the first turn while the configured renderer does not implement readPrompt (non-interactive/programmatic renderer).

Common situations: Driving the agent programmatically (tests, scripts) with a headless renderer; forgetting to pass the initial prompt; using a custom renderer that lacks readPrompt.

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/c1b28a6c40a6d2dc. Report an issue: GitHub.

Appendix: source

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

  async run() {
    const title = this.title;
    const messages: UIMessage[] = [];
    let nextMessageIndex = 0;
    const generateMessageId = () => `message-${++nextMessageIndex}`;
    let prompt: string | undefined;
    let hasRunTurn = false;
    let streamWithoutPrompt = false;

    while (true) {
      if (!streamWithoutPrompt) {
        if (prompt == null) {
          if (!this.renderer.readPrompt) {
            if (hasRunTurn) {
              return;
            }

            throw new Error(
              'No prompt was provided and the renderer does not support prompt input.',
            );
          }

          try {
            prompt = await this.renderer.readPrompt({ title });
          } catch (error) {
            if (isInterruptedError(error)) {
              return;
            }

            throw error;
          }

          if (prompt == null) {
            return;
          }
        }

View on GitHub (pinned to 69428b1f8b)