{"record":{"id":"c1b28a6c40a6d2dc","repo":"vercel/ai","slug":"no-prompt-was-provided-and-the-renderer-does-not-s","errorCode":null,"errorMessage":"No prompt was provided and the renderer does not support prompt input.","messagePattern":"No prompt was provided and the renderer does not support prompt input\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tui/src/agent-tui-runner.ts","lineNumber":130,"sourceCode":"\n  async run() {\n    const title = this.title;\n    const messages: UIMessage[] = [];\n    let nextMessageIndex = 0;\n    const generateMessageId = () => `message-${++nextMessageIndex}`;\n    let prompt: string | undefined;\n    let hasRunTurn = false;\n    let streamWithoutPrompt = false;\n\n    while (true) {\n      if (!streamWithoutPrompt) {\n        if (prompt == null) {\n          if (!this.renderer.readPrompt) {\n            if (hasRunTurn) {\n              return;\n            }\n\n            throw new Error(\n              'No prompt was provided and the renderer does not support prompt input.',\n            );\n          }\n\n          try {\n            prompt = await this.renderer.readPrompt({ title });\n          } catch (error) {\n            if (isInterruptedError(error)) {\n              return;\n            }\n\n            throw error;\n          }\n\n          if (prompt == null) {\n            return;\n          }\n        }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/tui/src/agent-tui-runner.ts#L112-L148","documentation":"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.","triggerScenarios":"Calling run() without a prompt on the first turn while the configured renderer does not implement readPrompt (non-interactive/programmatic renderer).","commonSituations":"Driving the agent programmatically (tests, scripts) with a headless renderer; forgetting to pass the initial prompt; using a custom renderer that lacks readPrompt.","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."],"exampleFix":"// before\nawait runner.run();\n// after\nawait runner.run({ prompt: 'fix the failing test' });","handlingStrategy":"validation","validationCode":"if (prompt == null && !renderer.readPrompt) {\n  throw new Error('Provide a prompt or use a renderer that implements readPrompt.');\n}","typeGuard":"null","tryCatchPattern":"try {\n  await runner.run(opts);\n} catch (error) {\n  if (error.message.includes('does not support prompt input')) {\n    await runner.run({ ...opts, prompt: fallbackPrompt });\n  } else throw error;\n}","preventionTips":["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."],"tags":["tui","input","config","api-misuse"],"backgroundTag":"missing-required-argument","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}