github pydantic/pydantic-ai v2.65.0
v2.65.0 (2026-11-02)

latest release: clai2-bleeding
3 hours ago

What's Changed

⚠️ Compatibility Notes

  • Protect the gh-aw canonical session capture from agent tools by @dsfaccini in #10606
  • Add multimodal notes to AskUserAnswer by @dsfaccini in #11664
  • Count BrowserUse model calls toward the host run's usage and UsageLimits by @mpfaffenberger in #11860
  • Name the V2 replacement when code imports a name V2 removed, like OpenAIModel or MCPServerStdio by @DouweM in #12035
  • Fall back to the next model in ModelFallback when a model refuses, and let ContentFilterError in fallback_on match refusals by @DouweM in #12039
  • Raise ModelQuotaExceededError instead of ModelRateLimitError for Z.ai balance and plan-limit 429s by @DouweM in #12042
  • Support the '12h' prompt cache retention on the OpenAI Responses API for GPT-5.6 and later by @DouweM in #12046
  • Send Google a server deadline of at least 20 minutes instead of the client's read timeout, and warn about httpx's 5 s default by @DouweM in #12057
  • Stop Temporal from retrying model errors that can't succeed on retry by default, via non_retryable_model_errors by @DouweM in #12107

🚀 Features

  • Add WebSocket transport to OpenAI Responses by @dsfaccini in #10444
  • Add ConversationStore, which keeps a conversation as a log of messages stored once, and Conversation.revision to catch conflicting saves by @DouweM in #10658
  • Add multimodal notes to AskUserAnswer by @dsfaccini in #11664
  • Add anthropic_web_tools_allowed_callers to set allowed_callers on Anthropic's web tools by @aweis89 in #10489
  • Support the '12h' prompt cache retention on the OpenAI Responses API for GPT-5.6 and later by @DouweM in #12046
  • Send mid-conversation system prompts natively on OpenRouter OpenAI routes and the Claude models that support them by @DouweM in #12056
  • Name the V2 replacement when code imports a name V2 removed, like OpenAIModel or MCPServerStdio by @DouweM in #12035
  • Fall back to the next model in ModelFallback when a model refuses, and let ContentFilterError in fallback_on match refusals by @DouweM in #12039

🐛 Bug Fixes

  • Raise ModelContextWindowExceededError and ModelQuotaExceededError for Bedrock errors on AsyncAnthropicBedrock by @DouweM in #12040
  • Raise ContentFilterError instead of TypeError when Azure filters a streamed OpenAIChatModel prompt by @DouweM in #12041
  • Re-surface nested RepoContext instruction files after compaction, and stop repeating notes still in history by @DouweM in #11704
  • Include the refusal text in ContentFilterError when the provider also reports a finish reason by @DouweM in #12036
  • Raise ModelQuotaExceededError instead of ModelRateLimitError for Z.ai balance and plan-limit 429s by @DouweM in #12042
  • Protect the gh-aw canonical session capture from agent tools by @dsfaccini in #10606
  • Close PlaywrightBrowser's Chromium and driver when an anyio scope cancels a run by @dsfaccini in #12047
  • Ask Coder to match the surrounding code's style instead of applying SOLID by @mpfaffenberger in #12120
  • Return a Coder tool's error to the model once its retries run out instead of ending the run by @mpfaffenberger in #12121
  • Keep *args and **kwargs docstring descriptions on tool parameters by @Aryapatel-007 in #12126
  • Read tool parameter descriptions from Keyword Args and Other Parameters docstring sections by @roydonsequeira in #10035
  • Let a retired aws_lambda agent loop finish its own cleanup at the grace deadline by @dsfaccini in #12140
  • Treat auth='' as unset alongside client in GitHub, Notion, Ordinal, PostHog, Pylon, and Slack by @mpfaffenberger in #11852
  • Count BrowserUse model calls toward the host run's usage and UsageLimits by @mpfaffenberger in #11860
  • Let FileSystem tools emit their events under PrefixTools by @mpfaffenberger in #11867
  • Forward cache='1h' to Claude Haiku 5.5 on Bedrock instead of snapping it to '5m' by @DouweM in #12045
  • Mark <context> elements in user and tool content as not from the application by @DouweM in #12050
  • Stop Temporal from retrying subclasses of non-retryable errors, like ContentFilterError or a UserError subclass by @DouweM in #12105
  • Stop Temporal from retrying model errors that can't succeed on retry by default, via non_retryable_model_errors by @DouweM in #12107
  • Stop sending a history container on Anthropic requests without code execution by @dsfaccini in #11764
  • Send Google a server deadline of at least 20 minutes instead of the client's read timeout, and warn about httpx's 5 s default by @DouweM in #12057
  • Place the OpenRouter Gemini message cache breakpoint before the final message, where it no longer doubles the billed prompt by @DouweM in #12048

📦 Dependencies

  • Remove the Daytona close() workaround and require daytona>=0.226.1 by @mislavivanda in #11977

New Contributors

Full Changelog: v2.64.0...v2.65.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.