NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #1583 most downloaded on PyPI
AI Agent Framework, the Pydantic way
Latest stable
2.68.0
Last release 8 days ago
12 Nov 2026
Ships on a steady schedule
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
3 years old
361 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
This comment was posted by Codex Desktop using gpt-6.1-sol on behalf of David.
This comment was posted by Codex Desktop using gpt-6.1-sol on behalf of David.
web_fetch: GHSA-4whf-38hw-pxxh. When web_fetch_tool fetched attacker-controlled HTML containing many elements, conversion could delay unrelated work in the same process. Fixed in v2.59.0 and v1.107.9. Upgrade if the tool can fetch such pages.playai-tts, playai-tts-arabic, meta-llama/llama-guard-4-12b and meta-llama/llama-4-maverick-17b-128e-instruct by @mekanbaymyradov in #10306UsageLimitUnavailableWarning by @mpfaffenberger in #9491on_change='append' to preserve dynamic instruction prefixes by @dsfaccini in #8188OutputItemCut lifecycle event by @DouweM in #10739LogfireMCP history instead of rewriting its instructions, keeping the prompt cache by @DouweM in #10543AnswersRevised by @DouweM in #10668ModelRateLimitError, ModelUnavailableError, ModelServerError and ModelContextWindowExceededError, and ModelHTTPError.for_category by @DouweM in #9354BackgroundTools results as <tool_result> tool output instead of untagged user text by @DouweM in #10548TrajectoryJudge steering as a framework SystemPromptPart note plus the judge message as escaped <judge_feedback> data, both marked with metadata by @DouweM in #10545tool_calls_limit before each CodeMode nested tool call by @dsfaccini in #10362GitHubCopilotProvider send a configurable copilot-integration-id via integration_id or GITHUB_COPILOT_INTEGRATION_ID by @dsfaccini in #10784DaytonaSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in a Daytona sandbox by @adtyavrdhn in #10610ElevenLabsRealtimeModel for Eleven Realtime speech-to-speech models by @DouweM in #10738FunctionToolset.instructions and instruction functions opt into on_change='append' by @DouweM in #10788FileSystem tools registered tool kinds and typed call parts by @DouweM in #10674non_retryable_model_errors to TemporalDurability to stop Temporal retrying specific model error categories by @DouweM in #10803commit_audio() by @DouweM in #10652metadata values from OpenAI-compatible chat completions by @dergachoff in #8010interrupt() races a failed send, the reply's end, or a later cancel by @DouweM in #10723agent_response_correction only to the message it names by @DouweM in #10709elevenlabs_agents_llm and elevenlabs_agents_tts model_id overrides on ElevenLabs Agents in Realtime voice mode by @DouweM in #10728contains constraints into descriptions by @dsfaccini in #10720$defs semantics during schema transformation by @dsfaccini in #10714DynamicWorkflow revealed type names, nested tool exposure, and empty WorkflowAgent descriptions by @mpfaffenberger in #10747BackgroundTools optional-tool args instead of raising RecursionError by @mpfaffenberger in #10721BackgroundTools tools that code mode's run_code calls, instead of a started message by @mpfaffenberger in #10750BackgroundTools instances with distinct ids select it by @mpfaffenberger in #10757auth='' as unset alongside client in DayAI and warn about tokens in Temporal history by @mpfaffenberger in #10718on_change='append' window that opened without blocks when a hook unsets instruction_parts by @DouweM in #10766split_bedrock_model_id, so they get the same model capabilities as the bare ID by @DouweM in #10664<assistant_thinking> tag so UI round trips keep the prompt cache by @DouweM in #10642CodeMode discovery announcements with SystemPromptPart.metadata, and announce a tool again when its announcement was dropped by @DouweM in #10666SummarizingCompaction summarizer transcript so tool output can't forge messages by @DouweM in #10544'asap' enqueue content into the same ModelRequest as the tool's ToolReturnPart by @divyankmalik in #7043const constraints, such as Literal discriminators, in Anthropic strict schemas by @DouweM in #10675<context_diff> instead of <context-diff> for instruction deltas by @DouweM in #10790ToolCallsAbandoned realtime lifecycle event, so an abandoned tool call no longer holds its exchange open by @DouweM in #10793grok-4.7 to xAI known models and Grok reasoning profile by @pydanty[bot] in #9750DeduplicateFileReads and ClearToolResults clear typed read_file results again by @DouweM in #10839TrajectoryJudge's steering note to its own frame with a ref, so forged <judge_feedback> tags get no authority by @DouweM in #10869Full Changelog: v2.58.0...v2.59.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This comment was posted by Codex Desktop using gpt-6.1-sol on behalf of David.
web_fetch: GHSA-4whf-38hw-pxxh. When web_fetch_tool fetched attacker-controlled HTML containing many elements, conversion could delay unrelated work in the same process. Fixed in v2.59.0 and v1.107.9. Upgrade if the tool can fetch such pages.playai-tts, playai-tts-arabic, meta-llama/llama-guard-4-12b and meta-llama/llama-4-maverick-17b-128e-instruct by @mekanbaymyradov in https://github.com/pydantic/pydantic-ai/pull/10306UsageLimitUnavailableWarning by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9491on_change='append' to preserve dynamic instruction prefixes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8188OutputItemCut lifecycle event by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10739LogfireMCP history instead of rewriting its instructions, keeping the prompt cache by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10543AnswersRevised by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10668ModelRateLimitError, ModelUnavailableError, ModelServerError and ModelContextWindowExceededError, and ModelHTTPError.for_category by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9354BackgroundTools results as <tool_result> tool output instead of untagged user text by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10548TrajectoryJudge steering as a framework SystemPromptPart note plus the judge message as escaped <judge_feedback> data, both marked with metadata by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10545tool_calls_limit before each CodeMode nested tool call by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10362GitHubCopilotProvider send a configurable copilot-integration-id via integration_id or GITHUB_COPILOT_INTEGRATION_ID by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10784DaytonaSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in a Daytona sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10610ElevenLabsRealtimeModel for Eleven Realtime speech-to-speech models by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10738FunctionToolset.instructions and instruction functions opt into on_change='append' by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10788FileSystem tools registered tool kinds and typed call parts by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10674non_retryable_model_errors to TemporalDurability to stop Temporal retrying specific model error categories by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10803commit_audio() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10652metadata values from OpenAI-compatible chat completions by @dergachoff in https://github.com/pydantic/pydantic-ai/pull/8010interrupt() races a failed send, the reply's end, or a later cancel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10723agent_response_correction only to the message it names by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10709elevenlabs_agents_llm and elevenlabs_agents_tts model_id overrides on ElevenLabs Agents in Realtime voice mode by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10728contains constraints into descriptions by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10720$defs semantics during schema transformation by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10714DynamicWorkflow revealed type names, nested tool exposure, and empty WorkflowAgent descriptions by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10747BackgroundTools optional-tool args instead of raising RecursionError by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10721BackgroundTools tools that code mode's run_code calls, instead of a started message by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10750BackgroundTools instances with distinct ids select it by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10757auth='' as unset alongside client in DayAI and warn about tokens in Temporal history by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10718on_change='append' window that opened without blocks when a hook unsets instruction_parts by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10766split_bedrock_model_id, so they get the same model capabilities as the bare ID by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10664<assistant_thinking> tag so UI round trips keep the prompt cache by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10642CodeMode discovery announcements with SystemPromptPart.metadata, and announce a tool again when its announcement was dropped by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10666SummarizingCompaction summarizer transcript so tool output can't forge messages by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10544'asap' enqueue content into the same ModelRequest as the tool's ToolReturnPart by @divyankmalik in https://github.com/pydantic/pydantic-ai/pull/7043const constraints, such as Literal discriminators, in Anthropic strict schemas by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10675<context_diff> instead of <context-diff> for instruction deltas by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10790ToolCallsAbandoned realtime lifecycle event, so an abandoned tool call no longer holds its exchange open by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10793grok-4.7 to xAI known models and Grok reasoning profile by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/9750DeduplicateFileReads and ClearToolResults clear typed read_file results again by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10839TrajectoryJudge's steering note to its own frame with a ref, so forged <judge_feedback> tags get no authority by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10869Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.58.0...v2.59.0
This comment was posted by codex-tui using gpt-6.1-sol on behalf of David.
This comment was posted by codex-tui using gpt-6.1-sol on behalf of David.
include_content=False. URL-based MCP capabilities could also expose a credential embedded in the URL-derived identifier. Fixed in v2.58.0 and v1.107.8. Restrict access to historical traces and rotate exposed credentials.MCP activity names remain unchanged to preserve in-flight workflows. With Temporal tracing enabled, also pass an explicit id= to MCP once in-flight workflows complete; changing it renames the activities.message_history and manage_system_prompt='server' (the default), Vercel AI and AG-UI adapters could execute an available tool with client-chosen arguments without a model request. Approval-required tools are not executed by this path. Fixed in v2.58.0; v1 is unaffected.'suspended' response's usage only in the run that produced it, in RunUsage, UsageLimits and SpendLimits by @DouweM in #10078RealtimeConnection yield lifecycle events through a public pydantic_ai.realtime.lifecycle module by @DouweM in #10353read_file return images and PDFs, and describe other binary files by @DouweM in #9596allowed_domains, blocked_domains, max_uses or external_web_access setting by @DouweM in #10451SystemPromptPart(scope='request') sent natively as Anthropic clear_at system messages by @DouweM in #9711WarnNearLimits warnings as request-scoped system prompts by @DouweM in #10561RepoContext <context-file> blocks and send the nested-directory pointer as a SystemPromptPart by @DouweM in #10558supports_auto_cache decide anthropic_cache, and use automatic caching on legacy AsyncAnthropicBedrock for Claude Opus 4.7 and later by @DouweM in #10551ToolKind with typed tool parts, and keep unknown kinds loadable by @DouweM in #9710Planning status-tool events after their store reads, so DBOS recovery with an event_stream_handler replays in order by @dsfaccini in #10343Planning with an event_stream_handler may not recover after upgrading; let in-flight workflows finish first or deploy a new DBOS application version.RealtimeTurnCompleteEvent with the exchange boundary that wait_for_reply() waits for by @DouweM in #10517PartEndEvents. Caption UIs should keep user parts open until their PartEndEvent, which can arrive after the reply completes.DelegationTasks.steer by @mpfaffenberger in #10359SqliteStepStore instead of repeating the history in every snapshot by @aweis89 in #9982ModelSettings['max_retries'] to set how many times the provider SDK retries a request by @DouweM in #10068timeout= and RunContext.deadline by @DouweM in #10070ctx.enqueue messages to Vercel AI and AG-UI frontends as history they send back but don't render by @DouweM in #10405ModelSettings['request_timeout'] covering all attempts and stream consumption of one model request by @DouweM in #10072PostgresStepStore and MongoStepStore instead of repeating the history in every snapshot by @DouweM in #10452Skills ignore include and exclude names no library has with unknown_names='skip' by @mpfaffenberger in #10506openai-chatgpt provider so app users can sign in with ChatGPT and use their plan by @mpfaffenberger in #10539timeout= on UI adapter run_stream(), run_stream_native() and dispatch_request() by @DouweM in #10553reasoning_summary to OpenAILiveResponsesDelegation to request the GPT-Live backend's reasoning summaries by @DouweM in #10514UnsupportedSettingWarning when a model ignores a setting like timeout, max_retries or stop_sequences by @DouweM in #10508openai_prune_tool_items to delete answered tool rounds from the OpenAI Realtime conversation by @DouweM in #10556ElevenLabsAgentsRealtimeModel to run realtime sessions on ElevenLabs Agents by @rscholz98 in #7964wait_for_reply() waiting forever when a realtime tool batch receives no reply after a call is cancelled by @DouweM in #10503RepoContext instruction file with its target's name, so CLAUDE.md -> AGENTS.md reads AGENTS.md by @mpfaffenberger in #10438ReinjectSystemPrompt(replace_existing=True) replaces the client's by @DouweM in #10389ModelResponse when VercelAIAdapter loads messages by @DouweM in #10404tool_choice='none' on BedrockConverseModel failing after a tool call by @DouweM in #10395thinking per step keeps tools stable by @DouweM in #10398ClearToolResults(max_messages=...) instead of on every request past the threshold by @DouweM in #10390MistralModel instead of filtering tools by @DouweM in #10394CachePoint after a replayed Anthropic MCP tool result by @DouweM in #10369FallbackModel by @DouweM in #10386run_stream() instead of returning a response that a model request hook rejected with ModelRetry by @DouweM in #10400Model instances a selector returns open inside async with agent: by @DouweM in #10377ThinkingParts in a user turn for models that imitate assistant formatting by @dsfaccini in #6692ToolCallPart.args_as_json_str() so UI round trips keep the prompt cache by @DouweM in #10410Model.prepare_messages so UI round trips keep the prompt cache by @DouweM in #10411AsyncInferenceClient that HuggingFaceProvider builds when the provider or agent exits by @DouweM in #10393ToolReturn(tools=...) reveals when a Vercel AI frontend rebuilds history from the event stream by @DouweM in #10401pydantic-ai engine when an earlier step wrote a noop to GH_AW_SAFE_OUTPUTS by @dsfaccini in #10450request_timeout by @DouweM in #10483RealtimeSession.context_window_used together with the usage it reports by @DouweM in #10467response.done closes it by @DouweM in #10511OpenAIResponsesModel._process_provider_details on streamed responses too by @DouweM in #10515anyio cancel ends a debounced stream_text(), stream_output() or stream_response() by @dsfaccini in #10448ModelProfile.tool_call_id_length and rewrite tool call IDs that Mistral models reject by @DouweM in #10519anthropic_cache) on AsyncAnthropicVertex by @DouweM in #10513propertyNames and contains when inlining JSON Schema definitions by @jukebox in #10588openai-codex or openai-chatgpt token refresh instead of reverting to the stored credentials it spent by @mpfaffenberger in #10615UserPromptParts through a VercelAIAdapter round trip by @DouweM in #10532CodeMode discovery announcements and stop recognizing announcements by their text by @DouweM in #10559RunUsage.__sub__, so durable runs keep one-hour cache writes and reasoning tokens, and declare cache_write_1h_tokens and output_reasoning_tokens by @DouweM in #10516send() of its last result failed by @DouweM in #10512UserPromptParts through an AGUIAdapter round trip by @DouweM in #10563openai_previous_response_id once the history before it has changed by @DouweM in #10509DeferredToolRequests to a parent that cannot resolve them by @DouweM in #10497openai_previous_response_id once the response itself has changed by @DouweM in #10656RealtimeError instead of a raw websockets exception when a GPT-Live connection drops without a reconnect policy by @DouweM in #10645ReasoningMessage.encrypted_value JSON in AGUIAdapter.load_messages by @DouweM in #10650format_as_xml mapping keys that aren't valid XML names to a key attribute by @DouweM in #10651UseEnumMemberDocstrings enums, Choices and BoolCriteria failing in Anthropic strict schemas by @DouweM in #10659$refs when merging JSON schema definitions by @limadog9 in #10601Full Changelog: v2.57.0...v2.58.0
Attach namespaced origin and tool_call_id metadata to BackgroundTools completions by @michaeldunn9 in #10196
origin and tool_call_id metadata to BackgroundTools completions by @michaeldunn9 in #10196disable-model-invocation and user-invocable in Skills, and skip stray skill library paths by @DouweM in #10378MetaProvider for Meta Muse models, with meta: using the Responses API by @mpfaffenberger in #10156ApprovalReviewer to let a model approve low-risk tool calls before a person sees them by @mpfaffenberger in #10143dataset_name to EvaluationReport by @jirikuncar in #10307MCPToolset.read_resource_contents by @adtyavrdhn in #10179MCPToolset.call_tool_for_app by @adtyavrdhn in #10190ToolReturnContent discriminator mapping by @Kludex in #10239OpenAIResponsesModel sending unavailable tool_choice names in allowed_tools by @dsfaccini in #10232extra_content) back from OpenAIChatModel by @dsfaccini in #10235prepare its own retry count under .prefixed(), .renamed() and PrefixTools by @dsfaccini in #10219GoogleModel by @miguel-flowstate in #8028tool_search to gpt-5.4-nano by @dsfaccini in #10272UIMessage JSON so the AI SDK accepts it by @adtyavrdhn in #10175Planning tool loops in the prompt cache, and attach a leading CachePoint to the previous user message on OpenRouterModel by @mpfaffenberger in #10257OpenAIChatModel's default 'auto' mode by @dsfaccini in #10251available_tool_names and active_capability_ids on run context copies inside Temporal activities and Render child tasks by @dsfaccini in #10280max_duration when a reconnect policy is set by @DouweM in #10056ProcessEventStream cleanup after early exit and cancellation by @dsfaccini in #10341FallbackModel response handlers are skipped on a streamed request by @DouweM in #10066async with agent: by @DouweM in #10067DBOS.sleep steps under DBOSDurability and DBOSAgent by @DouweM in #10383SpendLimits by @DouweM in #10069WarnNearLimits from deleting user prompts that quote its [WarnNearLimits] marker by @DouweM in #10391Full Changelog: v2.56.0...v2.57.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
origin and tool_call_id metadata to BackgroundTools completions by @michaeldunn9 in https://github.com/pydantic/pydantic-ai/pull/10196disable-model-invocation and user-invocable in Skills, and skip stray skill library paths by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10378MetaProvider for Meta Muse models, with meta: using the Responses API by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10156ApprovalReviewer to let a model approve low-risk tool calls before a person sees them by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10143dataset_name to EvaluationReport by @jirikuncar in https://github.com/pydantic/pydantic-ai/pull/10307MCPToolset.read_resource_contents by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10179MCPToolset.call_tool_for_app by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10190ToolReturnContent discriminator mapping by @Kludex in https://github.com/pydantic/pydantic-ai/pull/10239OpenAIResponsesModel sending unavailable tool_choice names in allowed_tools by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10232extra_content) back from OpenAIChatModel by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10235prepare its own retry count under .prefixed(), .renamed() and PrefixTools by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10219GoogleModel by @miguel-flowstate in https://github.com/pydantic/pydantic-ai/pull/8028tool_search to gpt-5.4-nano by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10272UIMessage JSON so the AI SDK accepts it by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10175Planning tool loops in the prompt cache, and attach a leading CachePoint to the previous user message on OpenRouterModel by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10257OpenAIChatModel's default 'auto' mode by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10251available_tool_names and active_capability_ids on run context copies inside Temporal activities and Render child tasks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10280max_duration when a reconnect policy is set by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10056ProcessEventStream cleanup after early exit and cancellation by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10341FallbackModel response handlers are skipped on a streamed request by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10066async with agent: by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10067DBOS.sleep steps under DBOSDurability and DBOSAgent by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10383SpendLimits by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10069WarnNearLimits from deleting user prompts that quote its [WarnNearLimits] marker by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10391Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.56.0...v2.57.0
Run BrowserUse on the host model by default and make browser-use telemetry opt-in by @mpfaffenberger in #9506
BrowserUse on the host model by default and make browser-use telemetry opt-in by @mpfaffenberger in #9506Skills layer project and personal libraries, name each skill's directory, and render a skill for a host command by @DouweM in #9802base_url argument to ZaiProvider by @aisk in #10099PGTaskDurability based on pgtask by @adtyavrdhn in #10174WarnNearLimits from the harness Coder capability by @adtyavrdhn in #9969SmolSandbox: a workspace that runs harness capabilities in a local smolvm microVM by @mpfaffenberger in #10148gemini-4-argon) on GoogleModel with long decode past the per-request output cap, and raise the Google providers' default timeout to 20 minutes by @dsfaccini in #10202send_audio() chunk whose send fails out of the realtime SpeechPart.audio recorded while it was sending by @DouweM in #10058auth to requests through MCPToolset(http_client=...) and stop closing the user-supplied client by @DouweM in #10051tool_choice to name output tools, and accept static lists that include one by @adtyavrdhn in #8565ModelAPIError when a 200 response from OpenAI Responses, Anthropic, Groq or OpenAI images has a text/plain body by @DouweM in #10065openai-codex backend by @aisk in #10103openai-decisions pricing before matching the shared OpenAI base URL by @dsfaccini in #10122mistral-large-4 and mistral-large-4-0 by @pydanty in #9967UsageLimits field to an explicit ACP stop reason by @mpfaffenberger in #9497gh-aw sessions by @dsfaccini in #10000drop_block when Bedrock rejects them by @mpfaffenberger in #9486import pydantic_ai.models on Pyodide by skipping the eager httpcore2 import on Emscripten by @adtyavrdhn in #10134SummarizingCompaction runs by @aweis89 in #9716CodeMode calls concurrently under parallel_ordered_events by @mpfaffenberger in #10137Memory snapshot with the latest user prompt instead of after tool results by @mpfaffenberger in #10192AnthropicModel picking native structured output that Bedrock rejects on AsyncAnthropicBedrock by @dsfaccini in #10207WorkspaceUnavailableError when a Sprite is deleted during a command, whatever its exit code by @mpfaffenberger in #10193genai-prices to 0.1.10 and keep tests passing on rich 15, dbos 3 and e2b 2.55 by @dsfaccini in #10077Full Changelog: v2.55.0...v2.56.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
BrowserUse on the host model by default and make browser-use telemetry opt-in by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9506Skills layer project and personal libraries, name each skill's directory, and render a skill for a host command by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9802base_url argument to ZaiProvider by @aisk in https://github.com/pydantic/pydantic-ai/pull/10099PGTaskDurability based on pgtask by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10174WarnNearLimits from the harness Coder capability by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/9969SmolSandbox: a workspace that runs harness capabilities in a local smolvm microVM by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10148gemini-4-argon) on GoogleModel with long decode past the per-request output cap, and raise the Google providers' default timeout to 20 minutes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10202send_audio() chunk whose send fails out of the realtime SpeechPart.audio recorded while it was sending by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10058auth to requests through MCPToolset(http_client=...) and stop closing the user-supplied client by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10051tool_choice to name output tools, and accept static lists that include one by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8565ModelAPIError when a 200 response from OpenAI Responses, Anthropic, Groq or OpenAI images has a text/plain body by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10065openai-codex backend by @aisk in https://github.com/pydantic/pydantic-ai/pull/10103openai-decisions pricing before matching the shared OpenAI base URL by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10122mistral-large-4 and mistral-large-4-0 by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9967UsageLimits field to an explicit ACP stop reason by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9497gh-aw sessions by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10000drop_block when Bedrock rejects them by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9486import pydantic_ai.models on Pyodide by skipping the eager httpcore2 import on Emscripten by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/10134SummarizingCompaction runs by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/9716CodeMode calls concurrently under parallel_ordered_events by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10137Memory snapshot with the latest user prompt instead of after tool results by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10192AnthropicModel picking native structured output that Bedrock rejects on AsyncAnthropicBedrock by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10207WorkspaceUnavailableError when a Sprite is deleted during a command, whatever its exit code by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10193genai-prices to 0.1.10 and keep tests passing on rich 15, dbos 3 and e2b 2.55 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/10077Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.55.0...v2.56.0
Require Python 3.11 or newer in every package; Python 3.10 installs resolve to 2.54.0 and earlier by @Kludex in #9526
ExaSearch, YouSearch, LocalStack and other harness capabilities under durable execution by @DouweM in #9705retain_audio_max_seconds by @DouweM in #9702LogfireMCP tool names with logfire_ by @mpfaffenberger in #9868FileUrl.media_type as null for extensionless URLs instead of raising by @pydanty in #8405run_id and conversation_id stable when a durable run is re-executed by @DouweM in #9701FallbackModel attempt with its model, timing, error and usage, and count rejected responses in RunUsage by @DouweM in #8745OpenAIDecisionsModel backend with image input by @DenysMoskalenko in #9634import pydantic_ai time by loading pydantic_ai.mcp only when an MCP capability needs it by @DouweM in #10046Conversation to carry and store a conversation between runs, accepted as conversation= by every entry point by @DouweM in #8337provider_details: on by default for OpenAI Responses, anthropic_cache_diagnostics opt-in by @DouweM in #9406pydantic_ai.cache.* span attributes and collapse events by @DouweM in #65342026-07-15 and apply parallel_tool_calls=False there by @DouweM in #9409warning events as Python warnings instead of dropping them by @DouweM in #9420openai_cache_instructions to place a prompt cache breakpoint on the instructions by @adtyavrdhn in #7559hang_up() to end a WebRTC call from the server on gpt-realtime and GPT-Live by @DouweM in #9342PostgresStepStore and PostgresMediaStore, the hosted Postgres backends for messages and media by @rscholz98 in #9899cache setting and Caching capability for cross-provider prompt caching by @adtyavrdhn in #7560claude-haiku-5-5 by @dsfaccini in #9998message_history into a WebRTC call through answer_webrtc_offer by @DouweM in #9338cache=True uses Anthropic's automatic caching by @DouweM in #10047Coder by @DouweM in #10040openai_live_idle_audio so text-only GPT-Live sessions work without a microphone by @DouweM in #9295auth.json as UTF-8 regardless of platform locale by @pydanty in #8254WarnOnCacheBusts warnings after native tool calls by @aweis89 in #9746durable_operation inline when it is called from inside a durable unit by @DouweM in #9700max_duration error instead of reconnecting into the same limit by @DouweM in #9415CachePoint to the previous message on OpenAI instead of raising by @DouweM in #9582run_stream_sync() mid-output by @DouweM in #9709BedrockEmbeddingModel errors as ModelHTTPError/ModelAPIError instead of an ExceptionGroup, and map botocore transport errors by @DouweM in #9314session.close by @DouweM in #9403idle_timeout_ms follow-up as an empty user turn by @DouweM in #9396delegate_task(resume=...) by @DouweM in #9783AgentRunResult's public shape in its validation JSON schema by @DouweM in #9791Planning's plan store calls under durable execution, so recovery doesn't repeat its writes by @DouweM in #9789Memory tool call under durable execution, so a forked DBOS workflow doesn't repeat its writes by @DouweM in #9832openai_prompt_cache_retention widen the cache-health window on GPT-5.6+ by @DouweM in #9851_meta.ui.visibility leaves out "model" from the model in MCPToolset by @adtyavrdhn in #9862moderation stub from SnowflakeModel responses by @specterbuilds in #9764$refs and draft-07 definitions in MCP TypeScript SDK tool schemas by @dsfaccini in #9643span_tree and metrics for run_on_errors evaluators when a task raises by @Diwak4r in #7070SystemOneModel question would have no instructions by @DouweM in #9848MCPReadOnlyNoToolsWarning to _warn so harness submodule imports stay light by @pydanty in #9922SpendLimits continuation chains per segment boundary so a durable retry charges newly billed segments by @mpfaffenberger in #10002cache={'messages': False} can't place an instruction breakpoint by @DouweM in #10007InputGuardrail blocks by @mpfaffenberger in #10003is_text_like_media_type by @pydanty in #9948BinaryContent.from_data_uri by @pydanty in #9950gpt-6.1-sol support on Bedrock Converse by @pydanty in #9817tool_call_id repeated within one response by @pydanty in #9819SummarizingCompaction tail budget by @pydanty in #9715Researcher construction under TemporalDurability and PrefectDurability by @pydanty in #9564FallbackModel ignoring handler functions in fallback_on tuples by @pydanty in #10031SummarizingCompaction summaries instead of replacing history with an empty summary by @aweis89 in #9748Retry-After HTTP dates by @ktz03 in #10023function_call_arguments.done or output_item.done by @DouweM in #10039Agent.to_web() for invalid chat requests by @DouweM in #10042EvaluationReport.render() and print() from parsing case, task and evaluator text as Rich markup by @lets-order-some-fries in #9544$refs under propertyNames and patternProperties when merging schema defs by @jayzuccarelli in #8805SlidingWindowCompaction receipt would take the only kept slot by @aweis89 in #9719parallel_ordered_events when a sibling raises or the run is cancelled by @DouweM in #10049StreamedRunResult.result by @DouweM in #10048null args fragment in AG-UI and Vercel AI adapters by @pydanty in #9724done snapshot disagrees, instead of starting the part again by @DouweM in #10044See file reference, not its repr, in harness compaction by @pepijn-m in #9632CodeMode run_code description by @mpfaffenberger in #9315merge_json_schema_defs corrupting branch schemas on transitive def-name collisions by @pydanty in #9735SpendLimits budgets for responses a FallbackModel rejected by @DouweM in #9792TextOutput JSON schema to infer the wrapped function's return annotation by @pydanty in #9652FallbackModel attempts once in SpendLimits when a failed continuation chain is retried by @DouweM in #10059ModelAPIError for transport errors that escaped Google, Mistral, Cohere, Hugging Face, Anthropic, Groq and Bedrock by @DouweM in #9336openai floor to 3.26.0 for Decisions support in the openai, openrouter, bedrock-mantle, zai, snowflake, crusoe and cerebras extras by @dsfaccini in #9968Full Changelog: v2.54.0...v2.55.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
ExaSearch, YouSearch, LocalStack and other harness capabilities under durable execution by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9705retain_audio_max_seconds by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9702LogfireMCP tool names with logfire_ by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9868FileUrl.media_type as null for extensionless URLs instead of raising by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8405run_id and conversation_id stable when a durable run is re-executed by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9701FallbackModel attempt with its model, timing, error and usage, and count rejected responses in RunUsage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8745OpenAIDecisionsModel backend with image input by @DenysMoskalenko in https://github.com/pydantic/pydantic-ai/pull/9634import pydantic_ai time by loading pydantic_ai.mcp only when an MCP capability needs it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10046Conversation to carry and store a conversation between runs, accepted as conversation= by every entry point by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8337provider_details: on by default for OpenAI Responses, anthropic_cache_diagnostics opt-in by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9406pydantic_ai.cache.* span attributes and collapse events by @DouweM in https://github.com/pydantic/pydantic-ai/pull/65342026-07-15 and apply parallel_tool_calls=False there by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9409warning events as Python warnings instead of dropping them by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9420openai_cache_instructions to place a prompt cache breakpoint on the instructions by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7559hang_up() to end a WebRTC call from the server on gpt-realtime and GPT-Live by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9342PostgresStepStore and PostgresMediaStore, the hosted Postgres backends for messages and media by @rscholz98 in https://github.com/pydantic/pydantic-ai/pull/9899cache setting and Caching capability for cross-provider prompt caching by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7560claude-haiku-5-5 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9998message_history into a WebRTC call through answer_webrtc_offer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9338cache=True uses Anthropic's automatic caching by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10047Coder by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10040openai_live_idle_audio so text-only GPT-Live sessions work without a microphone by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9295auth.json as UTF-8 regardless of platform locale by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8254WarnOnCacheBusts warnings after native tool calls by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/9746durable_operation inline when it is called from inside a durable unit by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9700max_duration error instead of reconnecting into the same limit by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9415CachePoint to the previous message on OpenAI instead of raising by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9582run_stream_sync() mid-output by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9709BedrockEmbeddingModel errors as ModelHTTPError/ModelAPIError instead of an ExceptionGroup, and map botocore transport errors by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9314session.close by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9403idle_timeout_ms follow-up as an empty user turn by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9396delegate_task(resume=...) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9783AgentRunResult's public shape in its validation JSON schema by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9791Planning's plan store calls under durable execution, so recovery doesn't repeat its writes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9789Memory tool call under durable execution, so a forked DBOS workflow doesn't repeat its writes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9832openai_prompt_cache_retention widen the cache-health window on GPT-5.6+ by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9851_meta.ui.visibility leaves out "model" from the model in MCPToolset by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/9862moderation stub from SnowflakeModel responses by @specterbuilds in https://github.com/pydantic/pydantic-ai/pull/9764$refs and draft-07 definitions in MCP TypeScript SDK tool schemas by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9643span_tree and metrics for run_on_errors evaluators when a task raises by @Diwak4r in https://github.com/pydantic/pydantic-ai/pull/7070SystemOneModel question would have no instructions by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9848MCPReadOnlyNoToolsWarning to _warn so harness submodule imports stay light by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9922SpendLimits continuation chains per segment boundary so a durable retry charges newly billed segments by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10002cache={'messages': False} can't place an instruction breakpoint by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10007InputGuardrail blocks by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/10003is_text_like_media_type by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9948BinaryContent.from_data_uri by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9950gpt-6.1-sol support on Bedrock Converse by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9817tool_call_id repeated within one response by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9819SummarizingCompaction tail budget by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9715Researcher construction under TemporalDurability and PrefectDurability by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9564FallbackModel ignoring handler functions in fallback_on tuples by @pydanty in https://github.com/pydantic/pydantic-ai/pull/10031SummarizingCompaction summaries instead of replacing history with an empty summary by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/9748Retry-After HTTP dates by @ktz03 in https://github.com/pydantic/pydantic-ai/pull/10023function_call_arguments.done or output_item.done by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10039Agent.to_web() for invalid chat requests by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10042EvaluationReport.render() and print() from parsing case, task and evaluator text as Rich markup by @lets-order-some-fries in https://github.com/pydantic/pydantic-ai/pull/9544$refs under propertyNames and patternProperties when merging schema defs by @jayzuccarelli in https://github.com/pydantic/pydantic-ai/pull/8805SlidingWindowCompaction receipt would take the only kept slot by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/9719parallel_ordered_events when a sibling raises or the run is cancelled by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10049StreamedRunResult.result by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10048null args fragment in AG-UI and Vercel AI adapters by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9724done snapshot disagrees, instead of starting the part again by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10044See file reference, not its repr, in harness compaction by @pepijn-m in https://github.com/pydantic/pydantic-ai/pull/9632CodeMode run_code description by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9315merge_json_schema_defs corrupting branch schemas on transitive def-name collisions by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9735SpendLimits budgets for responses a FallbackModel rejected by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9792TextOutput JSON schema to infer the wrapped function's return annotation by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9652FallbackModel attempts once in SpendLimits when a failed continuation chain is retried by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10059ModelAPIError for transport errors that escaped Google, Mistral, Cohere, Hugging Face, Anthropic, Groq and Bedrock by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9336openai floor to 3.26.0 for Decisions support in the openai, openrouter, bedrock-mantle, zai, snowflake, crusoe and cerebras extras by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9968Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.54.0...v2.55.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
items in JsonSchemaTransformer, TestModel and Mistral streamed output, and make TestModel accept boolean subschemas and cap prefixItems at maxItems by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9560ImageGeneration under FallbackModel and dataclasses.replace, and compare Embedder by identity by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9477wrap_* hooks enclose complete stage lifecycles by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7053BackgroundTools tool raises an unexpected exception, as a sequential tool does by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9434SubAgents agent_folders default-change warning: since v2.52.0 (#9023) the agents folder is not loaded by default, so pass agent_folders='agents' to keep loading it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9424RepoContext inventory by default by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9382CodeMode missing-return-schema warning its own CodeModeReturnSchemaWarning category by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9423cancel_and_resume example: cancel and resume a streaming run by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7012OpenAILiveModel sessions by forking a stored session or replaying the history by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9401create_async_httpx2_client() public by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9600gpt-live-transcribe for OpenAI realtime's default input_transcription_model='auto' and list gpt-transcribe by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9402WebSearchTool on OpenAI GPT-Live through its delegated backend by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9049native to ExaSearch and YouSearch to prefer the model's native web search, and web_search_tool() for WebSearch(local=...) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9386realpath fallback when readlink cannot read a symlink by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9613sniffio package in pydantic-evals and pydantic-ai-harness by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9620ImageGenerationTool to the local tool on Gemini text models, and keep tool output when a native tool falls back locally on Gemini 2.5 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9551null finish_reason on a SnowflakeModel response like an empty one by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9590LocalFileStore root another user owns, and log ToolOutputLimits spill and summarize fallbacks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9020ConversationSearch default-scope warning will be removed by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9383read_only=True removes every hosted MCP tool by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9387TrajectoryJudge window by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9425search_tools tool by its tool_kind instead of its name by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9603CodeMode by its tool_kind, so a prefixed search tool still gets its notes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9604LLMReminder generation failures instead of silently falling back to GoalReanchor text by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9024run_stream() usage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9694ModelResponse from streamed and complete GoogleModel responses, and add Gemini 3 web search sources by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9594RunCancelled.from_cancellation() when a DBOS workflow is cancelled by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9394setup_logfire callbacks replay-safe and add replay_safe to LogfirePlugin by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9698ModelAPIError for undecodable 200 response bodies from Anthropic, Bedrock, Groq, Hugging Face, Google, and OpenAI embeddings and images by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9350run_sync() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9605audio_output_sample_rate by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9399load_capability is called twice for it in one response by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9397ToolAvailabilityDeltaPart announcement out of the standing system prompt by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9413OpenAIChatModel streams by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8729BubblewrapWorkspace commands from running code on the SSH host through shell startup files or the SSHWorkspaceBackend stop script's PATH (VERIA-212) by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9673Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.53.0...v2.54.0
items in JsonSchemaTransformer, TestModel and Mistral streamed output, and make TestModel accept boolean subschemas and cap prefixItems at maxItems by @dsfaccini in #9560ImageGeneration under FallbackModel and dataclasses.replace, and compare Embedder by identity by @dsfaccini in #9477wrap_* hooks enclose complete stage lifecycles by @adtyavrdhn in #7053BackgroundTools tool raises an unexpected exception, as a sequential tool does by @DouweM in #9434SubAgents agent_folders default-change warning: since v2.52.0 (#9023) the agents folder is not loaded by default, so pass agent_folders='agents' to keep loading it by @DouweM in #9424RepoContext inventory by default by @DouweM in #9382CodeMode missing-return-schema warning its own CodeModeReturnSchemaWarning category by @DouweM in #9423cancel_and_resume example: cancel and resume a streaming run by @DouweM in #7012OpenAILiveModel sessions by forking a stored session or replaying the history by @DouweM in #9401create_async_httpx2_client() public by @DouweM in #9600gpt-live-transcribe for OpenAI realtime's default input_transcription_model='auto' and list gpt-transcribe by @DouweM in #9402WebSearchTool on OpenAI GPT-Live through its delegated backend by @DouweM in #9049native to ExaSearch and YouSearch to prefer the model's native web search, and web_search_tool() for WebSearch(local=...) by @DouweM in #9386realpath fallback when readlink cannot read a symlink by @dsfaccini in #9613sniffio package in pydantic-evals and pydantic-ai-harness by @pydanty in #9620ImageGenerationTool to the local tool on Gemini text models, and keep tool output when a native tool falls back locally on Gemini 2.5 by @dsfaccini in #9551null finish_reason on a SnowflakeModel response like an empty one by @DouweM in #9590LocalFileStore root another user owns, and log ToolOutputLimits spill and summarize fallbacks by @DouweM in #9020ConversationSearch default-scope warning will be removed by @DouweM in #9383read_only=True removes every hosted MCP tool by @DouweM in #9387TrajectoryJudge window by @DouweM in #9425search_tools tool by its tool_kind instead of its name by @DouweM in #9603CodeMode by its tool_kind, so a prefixed search tool still gets its notes by @DouweM in #9604LLMReminder generation failures instead of silently falling back to GoalReanchor text by @DouweM in #9024run_stream() usage by @DouweM in #9694ModelResponse from streamed and complete GoogleModel responses, and add Gemini 3 web search sources by @DouweM in #9594RunCancelled.from_cancellation() when a DBOS workflow is cancelled by @DouweM in #9394setup_logfire callbacks replay-safe and add replay_safe to LogfirePlugin by @DouweM in #9698ModelAPIError for undecodable 200 response bodies from Anthropic, Bedrock, Groq, Hugging Face, Google, and OpenAI embeddings and images by @DouweM in #9350run_sync() by @DouweM in #9605audio_output_sample_rate by @DouweM in #9399load_capability is called twice for it in one response by @DouweM in #9397ToolAvailabilityDeltaPart announcement out of the standing system prompt by @DouweM in #9413OpenAIChatModel streams by @pydanty in #8729BubblewrapWorkspace commands from running code on the SSH host through shell startup files or the SSHWorkspaceBackend stop script's PATH (VERIA-212) by @mpfaffenberger in #9673Full Changelog: v2.53.0...v2.54.0
Deprecate pydantic_ai_harness.step_persistence.naming by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9499
<!-- Release notes generated using configuration in .github/release.yml at main -->
This release fixes one security issue in ConcurrencyLimitedModel. See the advisory for full details and affected versions.
ConcurrencyLimitedModel or limit_model_concurrency could keep its concurrency slot when the slot was released on a different task than the one that acquired it: after an early exit (the consumer stopped iterating, raised, or was cancelled), and also after fully consuming stream_text() with its default debouncing. Repeated streams could then block every request sharing the limiter. Agent-level max_concurrency and non-streaming requests are not affected. Reported by @lche511. (#9478)The fix also changes how limiters are shared: a model wrapper now raises UserError when it shares a limiter with the agent making the request or with an enclosing model wrapper, ConcurrencyLimiter.acquire() takes a slot on every call, even on the same task, and a custom AbstractConcurrencyLimiter must allow release() from another task.
Patched in 2.53.0. v1 is not affected.
oneOf schema support to TestModel's generated data by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8783pydantic_ai_harness.step_persistence.naming by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9499usage by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8891AbsurdDurability to the harness as a replacement for pydantic-ai-absurd by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8946AskUser defer questions to the host and time out a slow answerer by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9509SystemOneModel to run decision models such as CLM and Laya over the /v1/systemone API by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/8942ToolCallJudge to assess tool calls before execution by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9041repair_messages by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8370LocalWorkspaceBackend.run timeout fires during process startup by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9358CodeMode analysis by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9475Memory toolset across runs so durable execution accepts it by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9489Planning toolset across runs so durable execution accepts it by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9507BubblewrapSandbox on the next launch by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9457inf/-inf/nan by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8852gemini-3.1-flash-image thinking efforts to minimal and high on the Gemini API by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9515UnexpectedModelBehavior instead of running the wrong tool when function tool calls share a tool_call_id by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8782XaiModel thinking part per output, matching the non-streamed response by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9416OpenAIResponsesModel replay when openai_store=False by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9388ModelResponse from streamed and complete OpenAIChatModel and OpenRouterModel responses by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9418OpenAIResponsesModel build the same ModelResponse from a stream as from a complete response by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9417commit_audio() alone no longer triggers a reply, and create_response() is always answered by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9070status, status_details and session values the SDK does not know yet by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9392SubAgents from forcing thinking on disk agents by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9384DynamicWorkflow reveal announcements after compaction or history loss by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9371ActivityConfig schema by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9577GoogleRealtimeModel declare tools whose dict values are recursive models by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9607Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.52.0...v2.53.0
This release fixes one security issue in ConcurrencyLimitedModel. See the advisory for full details and affected versions.
ConcurrencyLimitedModel or limit_model_concurrency could keep its concurrency slot when the slot was released on a different task than the one that acquired it: after an early exit (the consumer stopped iterating, raised, or was cancelled), and also after fully consuming stream_text() with its default debouncing. Repeated streams could then block every request sharing the limiter. Agent-level max_concurrency and non-streaming requests are not affected. Reported by @lche511. (#9478)The fix also changes how limiters are shared: a model wrapper now raises UserError when it shares a limiter with the agent making the request or with an enclosing model wrapper, ConcurrencyLimiter.acquire() takes a slot on every call, even on the same task, and a custom AbstractConcurrencyLimiter must allow release() from another task.
Patched in 2.53.0. v1 is not affected.
oneOf schema support to TestModel's generated data by @pydanty in #8783pydantic_ai_harness.step_persistence.naming by @mpfaffenberger in #9499usage by @pydanty in #8891AbsurdDurability to the harness as a replacement for pydantic-ai-absurd by @adtyavrdhn in #8946AskUser defer questions to the host and time out a slow answerer by @mpfaffenberger in #9509SystemOneModel to run decision models such as CLM and Laya over the /v1/systemone API by @mpfaffenberger in #8942ToolCallJudge to assess tool calls before execution by @DouweM in #9041repair_messages by @DouweM in #8370LocalWorkspaceBackend.run timeout fires during process startup by @dsfaccini in #9358CodeMode analysis by @mpfaffenberger in #9475Memory toolset across runs so durable execution accepts it by @mpfaffenberger in #9489Planning toolset across runs so durable execution accepts it by @mpfaffenberger in #9507BubblewrapSandbox on the next launch by @dsfaccini in #9457inf/-inf/nan by @pydanty in #8852gemini-3.1-flash-image thinking efforts to minimal and high on the Gemini API by @dsfaccini in #9515UnexpectedModelBehavior instead of running the wrong tool when function tool calls share a tool_call_id by @pydanty in #8782XaiModel thinking part per output, matching the non-streamed response by @DouweM in #9416OpenAIResponsesModel replay when openai_store=False by @DouweM in #9388ModelResponse from streamed and complete OpenAIChatModel and OpenRouterModel responses by @DouweM in #9418OpenAIResponsesModel build the same ModelResponse from a stream as from a complete response by @DouweM in #9417commit_audio() alone no longer triggers a reply, and create_response() is always answered by @DouweM in #9070status, status_details and session values the SDK does not know yet by @DouweM in #9392SubAgents from forcing thinking on disk agents by @DouweM in #9384DynamicWorkflow reveal announcements after compaction or history loss by @DouweM in #9371ActivityConfig schema by @pydanty in #9577GoogleRealtimeModel declare tools whose dict values are recursive models by @dsfaccini in #9607Full Changelog: v2.52.0...v2.53.0
Stop SubAgents loading agent files by default, and deprecate inherit_tools by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9023
This release fixes one security issue in web_fetch. See the advisory for full details and affected versions.
web_fetch tool could consume excessive CPU and memory. Provider-native web fetching is not affected. Reported by @SounLabs. (#8984)Patched in 2.52.0 (v2) and 1.107.7 (v1).
pydantic-ai-harness now lives in this repository and ships with every Pydantic AI release, so it jumps from 0.36.0 to 0.52.0.
Coder, FileSystem, Shell and the rest work through ctx.workspace, locally or in a sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8866ModalSandbox's own tools with a Modal workspace, so Coder, Shell and FileSystem run in the sandbox; ModalSandboxBackend replaces ModalSandboxSession by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8867AnthropicModel's default max_tokens from 4096 to 16384 on Claude Sonnet 4.5 and later by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9025DecisionModel's judged text after a retry by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8967SubAgents loading agent files by default, and deprecate inherit_tools by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9023AnthropicModel's max_tokens to the model's maximum output, streaming such requests behind the scenes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9298ctx.workspace gives tools one API for files and commands, on your machine or in a sandbox, with durable execution support by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6492SpritesSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in a Fly.io Sprite by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8869E2BSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in an E2B sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8868Coder file tools a retry budget of 5 and keep scratch files out of the project by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/8970claude-sonnet-5-5) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8974async_tool_call_mode with a shared async_tool_calls setting by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8813_process_provider_details hook to OpenAIResponsesModel by @pydanty in https://github.com/pydantic/pydantic-ai/pull/9094gemini-3.1-flash-live-preview and gemini-3.8-live by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9047answer_webrtc_offer and a sideband session by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9059SSHWorkspace and BubblewrapSandbox harness capabilities by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/8956azure_voice_live_voice to choose an Azure voice for Azure AI Voice Live sessions by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9044thinking, openai_turn_detection, openai_input_noise_reduction and a new azure_voice_live_temperature on Azure AI Voice Live by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9051gemini-3.8-live by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9058RequestUsage.extract() failures by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8564default_cache_retention + prompt_cache_outlook() cold-window helper; rename resolve_prompt_cache_retention() to resolve_cache_retention() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6337thinking and parallel_tool_calls settings to the GPT-Live backend model by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9040mxfp4, nvfp4, and mxfp8 OpenRouter quantizations and the exacto sort value by @harimaruthachalam in https://github.com/pydantic/pydantic-ai/pull/8888gpt-6.1-sol model support and allow image output on gpt-6-astra by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9305application/toml as text-like for inline model inputs by @JoeyTan21 in https://github.com/pydantic/pydantic-ai/pull/8848wait_for_reply() hanging on merged or failed replies by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8765ModelProfile so they apply on every provider route by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8808RealtimeTurnCompleteEvent before the spoken answer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8766output_type by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8812max_tokens by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8986response.create by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8763UserError instead of ModelRetry for Macroscope setup failures by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8999RequestUsage.details and price them in cost by @dltsum in https://github.com/pydantic/pydantic-ai/pull/8310compact_messages() by @yang0228 in https://github.com/pydantic/pydantic-ai/pull/8241azure_voice_live=True for gpt-realtime-2 models on AzureRealtimeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9050handshake_timeout by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9042gemini-live-2.5-flash and remove a stale Gemini Live docs claim by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9069DeferredToolRequestsEvent in realtime sessions before the HandleDeferredToolCalls handler runs by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9057ModelAPIError by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8846ModelAPIError in OpenAIChatModel, GroqModel and HuggingFaceModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9313ModelAPIError instead of ValidationError when an OpenRouterModel stream drops mid-response by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9312capabilities docs topic from capabilities/overview.md in PydanticAIDocs by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9011FileSystem default read_only_patterns to nested .env and .git/ paths by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9021CodeMode discovery announcements after compaction or history loss by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9045TrajectoryJudge window when the transcript is clamped by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9012ContentFilterError for a thinking-only response refused by the content filter, instead of retrying by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9355BubblewrapSandbox by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9349LogfireMCP instructions so they stop busting the prompt cache by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/9319ModelAPIError when the OpenAI Responses API reports a failed response or an error stream event by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9321MistralError from the Mistral SDK to ModelHTTPError or ModelAPIError by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9307GoogleModel.count_tokens and XaiModel file uploads by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9308ClampOversizedMessages, SubAgents, and StepPersistence by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9026data validation errors under result.data so retry feedback keeps the failing input by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8669shell job log deleted mid-read as empty instead of failing the call by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9322turn_complete_reason as the realtime response's finish_reason by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9390request_limit by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9380SubAgent usage toward parent budgets by @DouweM in https://github.com/pydantic/pydantic-ai/pull/9374Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.51.0...v2.52.0
This release fixes one security issue in web_fetch. See the advisory for full details and affected versions.
web_fetch tool could consume excessive CPU and memory. Provider-native web fetching is not affected. Reported by @SounLabs. (#8984)Patched in 2.52.0 (v2) and 1.107.7 (v1).
pydantic-ai-harness now lives in this repository and ships with every Pydantic AI release, so it jumps from 0.36.0 to 0.52.0.
Coder, FileSystem, Shell and the rest work through ctx.workspace, locally or in a sandbox by @adtyavrdhn in #8866ModalSandbox's own tools with a Modal workspace, so Coder, Shell and FileSystem run in the sandbox; ModalSandboxBackend replaces ModalSandboxSession by @adtyavrdhn in #8867AnthropicModel's default max_tokens from 4096 to 16384 on Claude Sonnet 4.5 and later by @DouweM in #9025DecisionModel's judged text after a retry by @dsfaccini in #8967SubAgents loading agent files by default, and deprecate inherit_tools by @DouweM in #9023AnthropicModel's max_tokens to the model's maximum output, streaming such requests behind the scenes by @DouweM in #9298ctx.workspace gives tools one API for files and commands, on your machine or in a sandbox, with durable execution support by @adtyavrdhn in #6492SpritesSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in a Fly.io Sprite by @adtyavrdhn in #8869E2BSandbox: a workspace that runs Coder, Shell, FileSystem and every other harness capability in an E2B sandbox by @adtyavrdhn in #8868Coder file tools a retry budget of 5 and keep scratch files out of the project by @mpfaffenberger in #8970claude-sonnet-5-5) support by @dsfaccini in #8974async_tool_call_mode with a shared async_tool_calls setting by @DouweM in #8813_process_provider_details hook to OpenAIResponsesModel by @pydanty in #9094gemini-3.1-flash-live-preview and gemini-3.8-live by @DouweM in #9047answer_webrtc_offer and a sideband session by @DouweM in #9059SSHWorkspace and BubblewrapSandbox harness capabilities by @mpfaffenberger in #8956azure_voice_live_voice to choose an Azure voice for Azure AI Voice Live sessions by @DouweM in #9044thinking, openai_turn_detection, openai_input_noise_reduction and a new azure_voice_live_temperature on Azure AI Voice Live by @DouweM in #9051gemini-3.8-live by @DouweM in #9058RequestUsage.extract() failures by @adtyavrdhn in #8564default_cache_retention + prompt_cache_outlook() cold-window helper; rename resolve_prompt_cache_retention() to resolve_cache_retention() by @DouweM in #6337thinking and parallel_tool_calls settings to the GPT-Live backend model by @DouweM in #9040mxfp4, nvfp4, and mxfp8 OpenRouter quantizations and the exacto sort value by @harimaruthachalam in #8888gpt-6.1-sol model support and allow image output on gpt-6-astra by @dsfaccini in #9305application/toml as text-like for inline model inputs by @JoeyTan21 in #8848wait_for_reply() hanging on merged or failed replies by @DouweM in #8765ModelProfile so they apply on every provider route by @DouweM in #8808RealtimeTurnCompleteEvent before the spoken answer by @DouweM in #8766output_type by @DouweM in #8812max_tokens by @DouweM in #8986response.create by @DouweM in #8763UserError instead of ModelRetry for Macroscope setup failures by @DouweM in #8999RequestUsage.details and price them in cost by @dltsum in #8310compact_messages() by @yang0228 in #8241azure_voice_live=True for gpt-realtime-2 models on AzureRealtimeModel by @DouweM in #9050handshake_timeout by @DouweM in #9042gemini-live-2.5-flash and remove a stale Gemini Live docs claim by @DouweM in #9069DeferredToolRequestsEvent in realtime sessions before the HandleDeferredToolCalls handler runs by @DouweM in #9057ModelAPIError by @pydanty in #8846ModelAPIError in OpenAIChatModel, GroqModel and HuggingFaceModel by @DouweM in #9313ModelAPIError instead of ValidationError when an OpenRouterModel stream drops mid-response by @DouweM in #9312capabilities docs topic from capabilities/overview.md in PydanticAIDocs by @DouweM in #9011FileSystem default read_only_patterns to nested .env and .git/ paths by @DouweM in #9021CodeMode discovery announcements after compaction or history loss by @DouweM in #9045TrajectoryJudge window when the transcript is clamped by @DouweM in #9012ContentFilterError for a thinking-only response refused by the content filter, instead of retrying by @DouweM in #9355BubblewrapSandbox by @mpfaffenberger in #9349LogfireMCP instructions so they stop busting the prompt cache by @mpfaffenberger in #9319ModelAPIError when the OpenAI Responses API reports a failed response or an error stream event by @DouweM in #9321MistralError from the Mistral SDK to ModelHTTPError or ModelAPIError by @DouweM in #9307GoogleModel.count_tokens and XaiModel file uploads by @DouweM in #9308ClampOversizedMessages, SubAgents, and StepPersistence by @DouweM in #9026data validation errors under result.data so retry feedback keeps the failing input by @pydanty in #8669shell job log deleted mid-read as empty instead of failing the call by @dsfaccini in #9322turn_complete_reason as the realtime response's finish_reason by @DouweM in #9390request_limit by @DouweM in #9380SubAgent usage toward parent budgets by @DouweM in #9374Full Changelog: v2.51.0...v2.52.0
<!-- Release notes generated using configuration in .github/release.yml at 39328d5b0d4cce94d513b6afcd2b3191bd5708d5 -->
<!-- Release notes generated using configuration in .github/release.yml at 39328d5b0d4cce94d513b6afcd2b3191bd5708d5 -->
gemini-3.8-live ids, reject google_affective_dialog on Gemini 3.1 Flash Live and 3.8 Live at connect, and raise RealtimeError for Gemini Live close codes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8761UserError for a realtime tool_choice that forces a tool call on OpenAI, Azure OpenAI, and xAI by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8755OpenAILiveModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8390context_window_used on realtime sessions, from GPT-Live's reported ratio or response usage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8803RunContext copying overhead in capability hooks by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8775provider_details on OpenAI Realtime tool-call responses and the response id on replies cut off by a drop or close() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8762CompletedStreamedResponse replay by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8799Agent.run() by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8658Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.50.0...v2.51.0
gemini-3.8-live ids, reject google_affective_dialog on Gemini 3.1 Flash Live and 3.8 Live at connect, and raise RealtimeError for Gemini Live close codes by @DouweM in #8761UserError for a realtime tool_choice that forces a tool call on OpenAI, Azure OpenAI, and xAI by @DouweM in #8755OpenAILiveModel by @DouweM in #8390context_window_used on realtime sessions, from GPT-Live's reported ratio or response usage by @DouweM in #8803RunContext copying overhead in capability hooks by @Kludex in #8775provider_details on OpenAI Realtime tool-call responses and the response id on replies cut off by a drop or close() by @DouweM in #8762CompletedStreamedResponse replay by @Kludex in #8799Agent.run() by @Kludex in #8658Full Changelog: v2.50.0...v2.51.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
DecisionModel which route to take by name, with one label per route by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8733ModelSelectionContext.messages end with the request being routed, and add ModelSelectionContext.prompt by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8737decision_route_threshold by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8739service_tier in provider details by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7945DecisionModel, a base for Decisions-protocol models, and make TypeSafeModel one by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8696RunContext.in_durable_context so hooks can tell they run in durable workflow code by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/8723gemini-3.8-live and gemini-3.8-live-extended-thinking realtime support by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8393DecisionModel's route fields with the route question under a route premise, with nested-field context and a done state after tool calls by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8749decide span for every request a DecisionModel sends by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8698OutputSpec[T] passed to Agent.run under mypy by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8730ThinkingParts in the history decision models judge by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8738RequestUsage.audio_seconds so duration-billed voice models are priced by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8427output_type as a route beside other routes, and rename ToolCallProposed to UnfillableRoute under a DecisionHandOff base by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8744wait_for_reply() no longer hangs on it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8747thinking=False on OpenAI Realtime by sending reasoning.effort: 'none' by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8753context_window from genai-prices and document compacting a Jev conversation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8740stream_audio() view so speaker-paced playback gets whole replies by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8750RealtimeSessionErrorEvent by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8752Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.49.0...v2.50.0
DecisionModel which route to take by name, with one label per route by @DouweM in #8733ModelSelectionContext.messages end with the request being routed, and add ModelSelectionContext.prompt by @DouweM in #8737decision_route_threshold by @DouweM in #8739service_tier in provider details by @pydanty in #7945DecisionModel, a base for Decisions-protocol models, and make TypeSafeModel one by @DouweM in #8696RunContext.in_durable_context so hooks can tell they run in durable workflow code by @mpfaffenberger in #8723gemini-3.8-live and gemini-3.8-live-extended-thinking realtime support by @DouweM in #8393DecisionModel's route fields with the route question under a route premise, with nested-field context and a done state after tool calls by @DouweM in #8749decide span for every request a DecisionModel sends by @DouweM in #8698OutputSpec[T] passed to Agent.run under mypy by @DouweM in #8730ThinkingParts in the history decision models judge by @DouweM in #8738RequestUsage.audio_seconds so duration-billed voice models are priced by @DouweM in #8427output_type as a route beside other routes, and rename ToolCallProposed to UnfillableRoute under a DecisionHandOff base by @DouweM in #8744wait_for_reply() no longer hangs on it by @DouweM in #8747thinking=False on OpenAI Realtime by sending reasoning.effort: 'none' by @DouweM in #8753context_window from genai-prices and document compacting a Jev conversation by @DouweM in #8740stream_audio() view so speaker-paced playback gets whole replies by @DouweM in #8750RealtimeSessionErrorEvent by @DouweM in #8752Full Changelog: v2.49.0...v2.50.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
GitHubCopilotOAuthFlow for device authorization by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8618BoolCriteria to say what a bool field's yes and no mean, and let a True/False Enum do the same by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8586None as the "none of these" option in TypeSafeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8684Choice in TypeSafeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8686RealtimeSession.wait_for_reply() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8514OpenAIChatModel logprobs in provider_details['logprobs'] by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8653gpt-6-sol, gpt-6-luna, and gpt-6-astra on Bedrock Converse by @sevakva in https://github.com/pydantic/pydantic-ai/pull/8656@GraphBuilder.stream node errors in-context during graph.iter() by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8304gs:// references as fileData in GoogleImageGenerationModel on Vertex AI by @dorukgezici in https://github.com/pydantic/pydantic-ai/pull/8225Annotated model types by @ikriv in https://github.com/pydantic/pydantic-ai/pull/8608None in a list of output types as | None so output_type=[Foo, Bar, None] passes pyright by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8641google_proactive_audio, which no Gemini Live session could ever connect with by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8394temperature and top_p for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse instead of failing with a 400 by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8668TypeSafeModel answers "None of these" for an optional field by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8685send_audio(iterable) cleanly on close by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8138Annotated metadata on the members of an X | Y output_type by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8687TypeSafeModel answers "None of these" for every field under it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8697Annotated, Literal and union output_types as PEP 747 TypeForms, and bump pyright to 1.1.414 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8690RunContext.tracer, trace_include_content and instrumentation_version follow an explicit Instrumentation capability by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8706OpenAICodexModel instead of failing with a 400 by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/8693Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.48.0...v2.49.0
GitHubCopilotOAuthFlow for device authorization by @Kludex in #8618BoolCriteria to say what a bool field's yes and no mean, and let a True/False Enum do the same by @DouweM in #8586None as the "none of these" option in TypeSafeModel by @DouweM in #8684Choice in TypeSafeModel by @DouweM in #8686RealtimeSession.wait_for_reply() by @DouweM in #8514OpenAIChatModel logprobs in provider_details['logprobs'] by @adtyavrdhn in #8653gpt-6-sol, gpt-6-luna, and gpt-6-astra on Bedrock Converse by @sevakva in #8656@GraphBuilder.stream node errors in-context during graph.iter() by @pydanty in #8304gs:// references as fileData in GoogleImageGenerationModel on Vertex AI by @dorukgezici in #8225Annotated model types by @ikriv in #8608None in a list of output types as | None so output_type=[Foo, Bar, None] passes pyright by @DouweM in #8641google_proactive_audio, which no Gemini Live session could ever connect with by @DouweM in #8394temperature and top_p for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse instead of failing with a 400 by @kimnamu in #8668TypeSafeModel answers "None of these" for an optional field by @DouweM in #8685send_audio(iterable) cleanly on close by @DouweM in #8138Annotated metadata on the members of an X | Y output_type by @DouweM in #8687TypeSafeModel answers "None of these" for every field under it by @DouweM in #8697Annotated, Literal and union output_types as PEP 747 TypeForms, and bump pyright to 1.1.414 by @DouweM in #8690RunContext.tracer, trace_include_content and instrumentation_version follow an explicit Instrumentation capability by @DouweM in #8706OpenAICodexModel instead of failing with a 400 by @aweis89 in #8693Full Changelog: v2.48.0...v2.49.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
genai-prices 0.1.7 and new OpenAI audio models by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8617gpt-6-sol and gpt-6-luna model support by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8635claude-opus-5-5) support by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8637UIMessage.id across Vercel AI load_messages and dump_messages by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8623Message.id across AGUIAdapter.load_messages and dump_messages by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8632genai-prices to 0.1.8 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8648Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.47.0...v2.48.0
genai-prices 0.1.7 and new OpenAI audio models by @adtyavrdhn in #8617gpt-6-sol and gpt-6-luna model support by @DouweM in #8635claude-opus-5-5) support by @DouweM in #8637UIMessage.id across Vercel AI load_messages and dump_messages by @adtyavrdhn in #8623Message.id across AGUIAdapter.load_messages and dump_messages by @adtyavrdhn in #8632Full Changelog: v2.47.0...v2.48.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
None output route None rather than NoneType by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8590UserPromptPart.content is not a str or a sequence, instead of silently sending a dict's keys by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8595TypeSafeModel can already answer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8544tuple output field and a self-contained model instead of crashing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8537None be a route TypeSafeModel can pick by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8540Choices set describe itself as a TypeSafeModel route by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8541None route and a None option that carry a description by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8598TypeSafeModel request that fills it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8589ag-ui-protocol to <1 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8579Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.46.0...v2.47.0
None output route None rather than NoneType by @DouweM in #8590UserPromptPart.content is not a str or a sequence, instead of silently sending a dict's keys by @DouweM in #8595tuple output field and a self-contained model instead of crashing by @DouweM in #8537None be a route TypeSafeModel can pick by @DouweM in #8540Choices set describe itself as a TypeSafeModel route by @DouweM in #8541None route and a None option that carry a description by @DouweM in #8598TypeSafeModel request that fills it by @DouweM in #8589ag-ui-protocol to <1 by @adtyavrdhn in #8579Full Changelog: v2.46.0...v2.47.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
TypeSafeModel fill a tool's arguments when Jev can express them by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8501RealtimeSession.wait_for_playback() and let the docs examples finish the reply before closing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8141supports_text_output to ModelProfile, and run LLMJudge and GEval on a model without it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8480typesafe_boolean_threshold for what a yes/no has to be before it is True by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8505TypeSafeModel fill a union of output types by choosing the type first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8481event_stream_topic to TemporalDurability to stream agent events via Workflow Streams by @brianstrauch in https://github.com/pydantic/pydantic-ai/pull/6639Enum's options by its member docstrings when it mixes in UseEnumMemberDocstrings by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8479Choices helper for a set of described options built at run time by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8530TypeSafeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8484ToolReturnPart when a realtime tool raises, and keep a tool call and its speech in one ModelResponse by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8135ToolDefinition in CombinedToolset and FunctionToolset by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8082ModelRetry when web_fetch_tool gets a URL httpx2 rejects as invalid by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8521usage.cost and UsageLimits.cost_limit work in a session by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8136Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.45.0...v2.46.0
TypeSafeModel fill a tool's arguments when Jev can express them by @DouweM in #8501RealtimeSession.wait_for_playback() and let the docs examples finish the reply before closing by @DouweM in #8141supports_text_output to ModelProfile, and run LLMJudge and GEval on a model without it by @DouweM in #8480typesafe_boolean_threshold for what a yes/no has to be before it is True by @DouweM in #8505TypeSafeModel fill a union of output types by choosing the type first by @DouweM in #8481event_stream_topic to TemporalDurability to stream agent events via Workflow Streams by @brianstrauch in #6639Enum's options by its member docstrings when it mixes in UseEnumMemberDocstrings by @DouweM in #8479Choices helper for a set of described options built at run time by @DouweM in #8530TypeSafeModel by @DouweM in #8484ToolReturnPart when a realtime tool raises, and keep a tool call and its speech in one ModelResponse by @DouweM in #8135ToolDefinition in CombinedToolset and FunctionToolset by @adtyavrdhn in #8082ModelRetry when web_fetch_tool gets a URL httpx2 rejects as invalid by @DouweM in #8521usage.cost and UsageLimits.cost_limit work in a session by @DouweM in #8136Full Changelog: v2.45.0...v2.46.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
TypeSafeModel for TypeSafe's Jev by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8450xhigh effort through on Bedrock when the model profile supports it by @willfrey in https://github.com/pydantic/pydantic-ai/pull/8392gpt-5.6-sol, gpt-5.6-luna, and gpt-5.6-terra on Bedrock Converse by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7825DynamicToolset once per durable run instead of inside every durable unit by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8455MCPSamplingModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8466httpx in pydantic_ai.mcp, which a FastMCP 4 install does not ship by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8461Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.44.0...v2.45.0
TypeSafeModel for TypeSafe's Jev by @adtyavrdhn in #8450xhigh effort through on Bedrock when the model profile supports it by @willfrey in #8392gpt-5.6-sol, gpt-5.6-luna, and gpt-5.6-terra on Bedrock Converse by @pydanty in #7825DynamicToolset once per durable run instead of inside every durable unit by @DouweM in #8455MCPSamplingModel by @DouweM in #8466httpx in pydantic_ai.mcp, which a FastMCP 4 install does not ship by @DouweM in #8461Full Changelog: v2.44.0...v2.45.0
This release fixes four security issues, all of them reached through web_fetch_tool or OpenTelemetry instrumentation. See each advisory for full detai
This release fixes four security issues, all of them reached through web_fetch_tool or OpenTelemetry instrumentation. See each advisory for full details and affected versions.
FileUrl(force_download='allow-local') or web_fetch_tool(allow_local_urls=True). Both are off by default. Reported by @euriconicacio. (#8401)web_fetch processed responses in superlinear time on the event loop, in both the HTML conversion and the charset decode, so a single attacker-chosen page could stall every agent in the process. Reported by @BrianWillows. (#8397, #8418, #8433)web_fetch_tool's domain lists were compared as written rather than in the form the resolver uses, so a blocked domain could be reached under another spelling. (#8407, #8421)InstrumentationSettings(include_content=False), spans still carried exceptions, error statuses, instructions and the output template. Reported by @BrianWillows. (#8403, #8408, #8419, #8428)Patched in 2.44.0 (v2) and 1.107.6 (v1).
RunContext.enqueue() safe from worker threads by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7758Content-Type on UI adapter requests by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8396@durable_operation called from a per-request hook, instead of silently running it inline by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8395AgentRunResult a stable serialized shape, and settle a finished stream into one by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8269Storage page so persistence is findable by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8336EnqueuedMessagesEvent when a realtime session delivers enqueued content by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8134blocked_domains to OpenAI web search by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8323tool_search pairing in AG-UI by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8313Agent.from_spec() construct without a model, deferring the requirement to run time by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8339RealtimeSession.close() finish its teardown when the closing task is cancelled by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8142prepare_tools over every tool the availability gate admits by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8071Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.43.0...v2.44.0
This release fixes four security issues, all of them reached through web_fetch_tool or OpenTelemetry instrumentation. See each advisory for full details and affected versions.
FileUrl(force_download='allow-local') or web_fetch_tool(allow_local_urls=True). Both are off by default. Reported by @euriconicacio. (#8401)web_fetch processed responses in superlinear time on the event loop, in both the HTML conversion and the charset decode, so a single attacker-chosen page could stall every agent in the process. Reported by @BrianWillows. (#8397, #8418, #8433)web_fetch_tool's domain lists were compared as written rather than in the form the resolver uses, so a blocked domain could be reached under another spelling. (#8407, #8421)InstrumentationSettings(include_content=False), spans still carried exceptions, error statuses, instructions and the output template. Reported by @BrianWillows. (#8403, #8408, #8419, #8428)Patched in 2.44.0 (v2) and 1.107.6 (v1).
RunContext.enqueue() safe from worker threads by @adtyavrdhn in #7758Content-Type on UI adapter requests by @DouweM in #8396@durable_operation called from a per-request hook, instead of silently running it inline by @DouweM in #8395AgentRunResult a stable serialized shape, and settle a finished stream into one by @DouweM in #8269Storage page so persistence is findable by @DouweM in #8336EnqueuedMessagesEvent when a realtime session delivers enqueued content by @DouweM in #8134blocked_domains to OpenAI web search by @adtyavrdhn in #8323tool_search pairing in AG-UI by @adtyavrdhn in #8313Agent.from_spec() construct without a model, deferring the requirement to run time by @DouweM in #8339RealtimeSession.close() finish its teardown when the closing task is cancelled by @DouweM in #8142prepare_tools over every tool the availability gate admits by @DouweM in #8071Full Changelog: v2.43.0...v2.44.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
clai sessions with it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7447OpenAIChatModel by @KaranJayakumar in https://github.com/pydantic/pydantic-ai/pull/8235Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.42.0...v2.43.0
OpenAIChatModel by @KaranJayakumar in #8235Full Changelog: v2.42.0...v2.43.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
DeferredToolResults.approvals values by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8081GitHubCopilotProvider for GitHub Copilot's OpenAI-compatible API by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8059anthropic_disallows_sampling_settings in BedrockConverseModel by @rscholz98 in https://github.com/pydantic/pydantic-ai/pull/7961$ref definitions inline in code-mode function signatures by @pydanty in https://github.com/pydantic/pydantic-ai/pull/8056ToolReturnContent without a Python call per JSON node by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7823Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.41.0...v2.42.0
DeferredToolResults.approvals values by @adtyavrdhn in #8081GitHubCopilotProvider for GitHub Copilot's OpenAI-compatible API by @dsfaccini in #8059anthropic_disallows_sampling_settings in BedrockConverseModel by @rscholz98 in #7961$ref definitions inline in code-mode function signatures by @pydanty in #8056ToolReturnContent without a Python call per JSON node by @dsfaccini in #7823Full Changelog: v2.41.0...v2.42.0
Deprecate fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in https://github.com/pydantic/pydantic-ai/p…
<!-- Release notes generated using configuration in .github/release.yml at main -->
fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8077openai-codex provider for ChatGPT/Codex subscription authentication by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7769ImageGenerator by @EgonFerri in https://github.com/pydantic/pydantic-ai/pull/5357RequestUsage.details and price them in cost by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8169ModelAPIError in BedrockConverseModel by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8131Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.40.0...v2.41.0
fallback_model in favor of fallback_subagent_model on ImageGeneration and XSearch by @dsfaccini in #8077openai-codex provider for ChatGPT/Codex subscription authentication by @mpfaffenberger in #7769ImageGenerator by @EgonFerri in #5357RequestUsage.details and price them in cost by @adtyavrdhn in #8169ModelAPIError in BedrockConverseModel by @kimnamu in #8131Full Changelog: v2.40.0...v2.41.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
pydantic_ai.prices.update_in_background() by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4841handle_barge_in=True, interrupt(played_bytes=...), and played_audio_bytes by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7870provider_factory to infer_realtime_model by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8106@agent.on_event for registering event listeners on an Agent by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8101respond= to RealtimeSession.send() and document that a text turn solicits a reply by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8110RealtimeSession.enqueue() for out-of-band prompts from code driving the session by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8109finish_reason on OpenAI Responses stream terminal events by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7916defer_loading reveal synthesis splitting a parallel batch's tool_result from its tool_use by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7879reasoning to the dated gpt-realtime-2025-08-28 snapshot by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8103stream_audio() and stream_transcripts() views when they are called, not on first iteration by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8107ctx.realtime_session.close() instead of wedging itself by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8105interrupt(played_ms=) cancel race, and two provider tables by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8132Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.39.0...v2.40.0
pydantic_ai.prices.update_in_background() by @adtyavrdhn in #4841handle_barge_in=True, interrupt(played_bytes=...), and played_audio_bytes by @DouweM in #7870provider_factory to infer_realtime_model by @DouweM in #8106@agent.on_event for registering event listeners on an Agent by @DouweM in #8101respond= to RealtimeSession.send() and document that a text turn solicits a reply by @DouweM in #8110RealtimeSession.enqueue() for out-of-band prompts from code driving the session by @DouweM in #8109finish_reason on OpenAI Responses stream terminal events by @pydanty in #7916defer_loading reveal synthesis splitting a parallel batch's tool_result from its tool_use by @pydanty in #7879reasoning to the dated gpt-realtime-2025-08-28 snapshot by @DouweM in #8103stream_audio() and stream_transcripts() views when they are called, not on first iteration by @DouweM in #8107ctx.realtime_session.close() instead of wedging itself by @DouweM in #8105interrupt(played_ms=) cancel race, and two provider tables by @DouweM in #8132Full Changelog: v2.39.0...v2.40.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
gpt-6-astra model support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8055context_subtree() exporter cache and its span-processor leaks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7667Instrumentation spec option include_model_request_parameters and sharpen the undeclared-attribute merge error by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8046AzureProvider and for AsyncAzureOpenAI clients on OpenAIProvider by @quinnarnold in https://github.com/pydantic/pydantic-ai/pull/7922stream_transcripts() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8062Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.38.0...v2.39.0
gpt-6-astra model support by @dsfaccini in #8055context_subtree() exporter cache and its span-processor leaks by @dsfaccini in #7667Instrumentation spec option include_model_request_parameters and sharpen the undeclared-attribute merge error by @DouweM in #8046AzureProvider and for AsyncAzureOpenAI clients on OpenAIProvider by @quinnarnold in #7922stream_transcripts() by @DouweM in #8062Full Changelog: v2.38.0...v2.39.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
id and a combine rule for repeats by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7248context_window to ModelProfile and context_window_used to RunContext by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4611finish_reason by @jonashaag in https://github.com/pydantic/pydantic-ai/pull/7096gemini-3.8-flash model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8021CustomEvents and CapabilityEvents into the run event stream and subscribe with @on_event by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6258claude-fable-5-1) and Claude Mythos 5.1 (claude-mythos-5-1) support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7989VLLMProvider for vLLM servers by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6153CancellationToken in UI adapter run methods by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7743pytest tests/durable_exec/temporal from crashing when the suite's requirements are missing by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7898tool_choice handling and support NativeOutput on DeepSeek's Responses API by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7450CodeExecutionTool uploads never reaching a fresh Anthropic container on a multi-turn history by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7864REASONING_* events from ag-ui-protocol 0.1.11 instead of 0.1.13 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7226GoogleProvider's overload by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8030XaiModel streamed text after a native tool call being merged into the ended pre-call part by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/7925native factory config in XSearch and ImageGeneration fallback subagents by @CoralGarden52 in https://github.com/pydantic/pydantic-ai/pull/7541genai-prices to 0.1.6 by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8019Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.37.0...v2.38.0
id and a combine rule for repeats by @dsfaccini in #7248context_window to ModelProfile and context_window_used to RunContext by @adtyavrdhn in #4611finish_reason by @jonashaag in #7096gemini-3.8-flash model by @dsfaccini in #8021CustomEvents and CapabilityEvents into the run event stream and subscribe with @on_event by @DouweM in #6258claude-fable-5-1) and Claude Mythos 5.1 (claude-mythos-5-1) support by @dsfaccini in #7989VLLMProvider for vLLM servers by @adtyavrdhn in #6153CancellationToken in UI adapter run methods by @dsfaccini in #7743pytest tests/durable_exec/temporal from crashing when the suite's requirements are missing by @dsfaccini in #7898tool_choice handling and support NativeOutput on DeepSeek's Responses API by @dsfaccini in #7450CodeExecutionTool uploads never reaching a fresh Anthropic container on a multi-turn history by @dsfaccini in #7864REASONING_* events from ag-ui-protocol 0.1.11 instead of 0.1.13 by @dsfaccini in #7226GoogleProvider's overload by @dsfaccini in #8030XaiModel streamed text after a native tool call being merged into the ended pre-call part by @pydanty[bot] in #7925native factory config in XSearch and ImageGeneration fallback subagents by @CoralGarden52 in #7541genai-prices to 0.1.6 by @adtyavrdhn in #8019Full Changelog: v2.37.0...v2.38.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
glm-5.3-flash and rework the Z.AI test suite onto cassettes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7887finish_reason values by @zhj12395 in https://github.com/pydantic/pydantic-ai/pull/7685TEXT_MESSAGE_START for the assistant message that owns a response's tool calls by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7699GoogleModel by client transport instead of provider name by @thejamesgore in https://github.com/pydantic/pydantic-ai/pull/7280capabilities= on DBOS, matching Temporal by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6955Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.36.0...v2.37.0
glm-5.3-flash and rework the Z.AI test suite onto cassettes by @dsfaccini in #7887finish_reason values by @zhj12395 in #7685TEXT_MESSAGE_START for the assistant message that owns a response's tool calls by @dsfaccini in #7699GoogleModel by client transport instead of provider name by @thejamesgore in #7280capabilities= on DBOS, matching Temporal by @DouweM in #6955Full Changelog: v2.36.0...v2.37.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
--mcp-config support and tool-call streaming to clai by @Kludex in https://github.com/pydantic/pydantic-ai/pull/1374@durable_operation for capabilities and a public backend API for third-party durable execution engines by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6696InstructionPart.id by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6887RealtimeSession.send_audio() and move the voice example to listentome by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7860@durable_operation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7868TestModel generation for narrow exclusive numeric bounds by @Terminator666666 in https://github.com/pydantic/pydantic-ai/pull/7800ToolDefinition into Prefect cache keys by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7872Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.3...v2.36.0
@durable_operation for capabilities and a public backend API for third-party durable execution engines by @DouweM in #6696InstructionPart.id by @DouweM in #6887RealtimeSession.send_audio() and move the voice example to listentome by @DouweM in #7860@durable_operation by @DouweM in #7868TestModel generation for narrow exclusive numeric bounds by @Terminator666666 in #7800ToolDefinition into Prefect cache keys by @DouweM in #7872Full Changelog: v2.35.3...v2.36.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
zai_model_profile by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6837safe_download cookies to original hostnames by @Diwak4r in https://github.com/pydantic/pydantic-ai/pull/7077DeferredToolRequests.remaining resolving cross-category result IDs by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7626dbos extra; add opentelemetry-instrumentation-logging as a test dependency instead by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7820Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.1...v2.35.3
zai_model_profile by @LHMQ878 in #6837safe_download cookies to original hostnames by @Diwak4r in #7077DeferredToolRequests.remaining resolving cross-category result IDs by @pydanty in #7626dbos extra; add opentelemetry-instrumentation-logging as a test dependency instead by @dsfaccini in #7820Full Changelog: v2.35.1...v2.35.3
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
trace in ModelResponse.provider_details by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7562provider_factory when cancelling Temporal responses by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7000dbos below 2.31.0 to avoid a missing opentelemetry-instrumentation-logging import by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7804Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.35.0...v2.35.1
trace in ModelResponse.provider_details by @pydanty in #7562provider_factory when cancelling Temporal responses by @DouweM in #7000dbos below 2.31.0 to avoid a missing opentelemetry-instrumentation-logging import by @dsfaccini in #7804Full Changelog: v2.35.0...v2.35.1
Deprecate RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in https://gith…
<!-- Release notes generated using configuration in .github/release.yml at main -->
RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7454maximum reachable in TestModel by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7697Tool description instead of falling back to the function docstring by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7759Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.34.0...v2.35.0
RunContext.capability_loaded and available_capability_ids in favor of capability_active and active_capability_ids by @DouweM in #7454maximum reachable in TestModel by @pydanty in #7697Tool description instead of falling back to the function docstring by @mpfaffenberger in #7759Full Changelog: v2.34.0...v2.35.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
ZaiModel by @aisk in https://github.com/pydantic/pydantic-ai/pull/7600TestModel generation for equal inclusive bounds by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7642Literal in FunctionSignature by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7579TestModel generation of falsy JSON Schema const values by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7630UIEventStream part state on cancellation by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7675logit_bias from Cerebras model settings by @ryanl-cerebras in https://github.com/pydantic/pydantic-ai/pull/7653VercelAIAdapter rejecting reasoning part id in run input by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7706CohereModel by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7720VercelProvider dropping the Groq profile for groq/-prefixed models by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7551SpanQuery maximums by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6934Retry-After dates in wait_retry_after() by @parveshsaini in https://github.com/pydantic/pydantic-ai/pull/7711load_capability by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6937r1 alias in deepseek_model_profile() by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7723Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.33.0...v2.34.0
ZaiModel by @aisk in #7600TestModel generation for equal inclusive bounds by @pydanty in #7642Literal in FunctionSignature by @pydanty in #7579TestModel generation of falsy JSON Schema const values by @pydanty in #7630UIEventStream part state on cancellation by @adtyavrdhn in #7675logit_bias from Cerebras model settings by @ryanl-cerebras in #7653VercelAIAdapter rejecting reasoning part id in run input by @pydanty in #7706CohereModel by @pydanty in #7720VercelProvider dropping the Groq profile for groq/-prefixed models by @pydanty in #7551SpanQuery maximums by @lntutor in #6934Retry-After dates in wait_retry_after() by @parveshsaini in #7711load_capability by @lntutor in #6937r1 alias in deepseek_model_profile() by @adtyavrdhn in #7723Full Changelog: v2.33.0...v2.34.0
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
anthropic 1.0.0 — rebuilt on httpx2, with legacy httpx support removed — reached PyPI on August 20. Every earlier pydantic-ai release, including v2.32.2 cut a few hours before this one, allowed that version without supporting it: a fresh or unpinned install of pydantic-ai[anthropic] could resolve anthropic 1.0.0 and then fail at runtime when using an Anthropic model. Apologies for the breakage window.
pydantic-ai v2.33.0, which requires and supports anthropic>=1.0.0.anthropic<1.If you pass your own http_client to AnthropicProvider, it must now be an httpx2.AsyncClient — the 1.x SDK rejects legacy httpx clients at construction.
httpx2 for Anthropic clients by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7657Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.32.2...v2.33.0
One column per month.