agent.run(), agent.stream(), and agent.runStreamEvents().
Tool-level retries
The SDK does expose one retry mechanism: per-tool execution retries. SetmaxRetries on any ToolDefinition to re-attempt a failing tool call before propagating the error:
maxRetries applies only to the tool’s own execute function. It does not retry the model call that triggered the tool.
Result validation retries
TheAgent constructor accepts a maxRetries option for structured output validation. When outputSchema is set and the model produces output that fails Zod validation, the SDK retries the model call up to maxRetries times (default: 3):
MaxRetriesError is thrown. See Error Handling for recovery patterns.
Model-level retries (Vercel AI SDK)
For retrying transient provider errors (network failures, rate limits, 5xx responses), configure the Vercel AI SDK provider or wrap the model:Rate limits
Rate limit errors from a provider arrive asAPICallError with statusCode: 429. The Vibes SDK does not automatically back off on rate limits — implement exponential backoff at the call site or via AI SDK middleware:
For comprehensive error handling including
MaxTurnsError, UsageLimitError, and ApprovalRequiredError, see Error Handling.