github pydantic/pydantic-ai v2.26.0
v2.26.0 (2026-08-06)

5 hours ago

What's Changed

🚀 Features

  • Support hiding function tools until revealed — via tool search, load_capability, or ToolReturn.tools — using each provider's native deferral/addition channel by @DouweM in #7104
  • Add first-party run cancellation: AgentRun.cancel(), RunContext.cancel(), RunCancelled by @DouweM in #6497
  • Add Model.resolve_prompt_cache_retention() to resolve effective prompt-cache retention from model settings by @DouweM in #7254
  • Promote run_stream_events() iterator to public AgentRunEvents handle with cancel() and run-state access by @DouweM in #6498
  • Cover and document DeepSeek V4 Flash via OpenAIResponsesModel + DeepSeekProvider by @dsfaccini in #7202

🐛 Bug Fixes

  • Forward model_id through WrapperModel and resolve it against the active model in TemporalModel by @dsfaccini in #7181
  • Map streamed OpenRouter reasoning details by their index by @VictorPeralta in #7214
  • Gate OpenRouter off native mid-conversation system messages with supports_inline_system_prompts=False by @DouweM in #7253
  • Restore the released legacy profile-key shim and fix two reveal-state edges (is_tool_available, TestModel native additions) by @DouweM in #7260
  • Keep deferred tools searchable after discovery and reset reveal state at CompactionPart boundaries by @DouweM in #7225
  • Forward events from UIEventStream callbacks that return an async iterator without being an async generator function by @DouweM in #7256
  • Send only the compacted window: drop history before the latest same-provider CompactionPart by @DouweM in #7228

New Contributors

Full Changelog: v2.25.0...v2.26.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.