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
- Pass a prompt string to run().
- Use a renderer that implements readPrompt for interactive input.
- Check this.renderer.readPrompt support before running without a prompt.
- 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
- Always pass an initial prompt in non-interactive contexts.
- Verify renderer capabilities before run().
- Implement readPrompt in custom renderers.
- Skip interactive renderers in tests/scripts.
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
- Could not find tool approval request
- Tool approval was requested, but the renderer does not…
- Cline MCP server must define a transport, command, or URL.
- 'element streams in enum mode' functionality not supported.
- 'element streams in no-schema mode' functionality not…
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)