Skip to main content
The Vibes SDK does not implement its own HTTP retry layer. Retry behaviour for model API calls is fully delegated to the Vercel AI SDK, which is the underlying transport used by agent.run(), agent.stream(), and agent.runStreamEvents().

Tool-level retries

The SDK does expose one retry mechanism: per-tool execution retries. Set maxRetries 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

The Agent 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):
When all retries are exhausted, a 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:
Refer to the Vercel AI SDK middleware documentation for the full API.

Rate limits

Rate limit errors from a provider arrive as APICallError 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.