Refacto Agents

Industry story

Pydantic AI v2.2.0 adds Claude Sonnet 5 and retry options

engineering

Full analysis

Pydantic AI, a Python framework for building type-safe AI agents, released v2.2.0 on June 30, 2026. Key new features include support for Anthropic's Claude Sonnet 5 model, a retry_options parameter for the Google provider (allowing agents to customize retry behavior), and cost-tracking fields for prompt and completion tokens via OpenRouter. A TwelveLabs Pegasus video-understanding example was also added, extending the framework's multimodal capabilities.

The release also ships a range of bug fixes relevant to agent builders: corrected reasoning-token surfacing for Groq models, fixes to Heroku routing that prevented 'thinking' mode from being silently dropped, and a fix for ClosedResourceError when cancelling a graph run mid-send — the last being directly relevant to long-running agentic workflows. Dataset evaluation now supports factory functions as lifecycle arguments, improving flexibility in agent eval pipelines.

Comments