pypi / pydantic-ai-slim
pydantic-ai-slim
What changed in pydantic-ai-slim 1 to 2, from its official release notes, upgrade guides and advisories. Also covers pydantic-evals. Sources checked 2026-12-05.
196 breaking58 security47 deprecations664 new APIs and options11 performance183 behavior and defaults992 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpydantic-ai-slim 21522 changes
Breaking changes 171
Runs remain paused when content is queued at DeferredToolRequests or PendingModelResponse pauses; BackgroundTools waits for its tasks at a DeferredToolRequests pause.
PeerNetwork is renamed to PeerConnection.
Peers(network) joins an InMemoryPeerNetwork under the agent's name; PeerNetwork is renamed to PeerConnection.
Fixes JSON output and reasoning flags; raises UserError for NativeOutput with function tools.
Raises immediately when the token limit cuts off an output tool call instead of retrying.
Fixes quadratic-time backtracking in the secret-redaction JWT pattern; the fixed pattern no longer matches JWTs whose header segment contains -eyJ.
Raised before OpenAIChatModel sends tools to GPT-6 models with reasoning enabled.
Its
strict,sequential,defer_loading, andinclude_return_schemadefaults now apply toToolinstances.Raises Gemini API errors as their error category, such as
ModelRateLimitError.Gave-up transport status or connection errors from Google embeddings, image generation, and token counting are raised as
ModelAPIError.Now incorporates RequestInput, and its handler can take a resume token.
OpenRouter's flag is no longer counted as a usage detail.
Mistral
3059prompt-too-long errors raise this error, while other3051invalid-argument errors do not.Retrying transports that give up on an HTTP status now raise it as
ModelHTTPErrorfor the listed Gemini, embedding, image-generation, and batch paths.Raises OpenAI API and connection errors as their error category, such as
ModelRateLimitError.Structured tool return items next to a file are sent to the model as JSON rather than escaped JSON strings.
Rejects functions taking a model, dataclass, or
TypedDictwhen the agent is created.Text in user and tool content that looks like an application frame is noted instead of escaped.
Renames outlier events to <Subject><PastParticiple>Event and adds STEP_PERSISTENCE_EVENTS.
Renames num_results to max_results and max_duration_secs to max_duration_seconds.
Workspace backends are required to leave detached processes running.
Runs are refused when
directoryis belowoperatorauthority.Rejects tools named after Python builtins, which the sandbox would otherwise call instead of the tool.
Raises
UserErrorfor nodes that are not JSON Schemas.Raises immediately instead of retrying when token limits truncate text that fails validation.
An OpenAI response without a
history_digestis no longer continued through this setting.Provider-specific native-tool fields move to
provider_settings.Raises
UserErrorif arun_stream()run stops while finishing.FunctionToolset(requires_approval=True)is now applied toToolinstances passed to the toolset.Counts its model calls toward the host run's usage and
UsageLimits.Z.ai balance and plan-limit 429s now raise
ModelQuotaExceededErrorinstead ofModelRateLimitError.Adds a way to prevent Temporal from retrying model errors that cannot succeed on retry; this is the default behavior.
Coder tool schemas are no longer strict by default; pass strict=True to opt in.
RealtimeEvent is removed from pydantic_ai.agent.__all__ because it cannot be resolved.
AdvisorTool is no longer offered on AsyncAnthropicBedrockMantle because that integration rejects it.
dynamic_catalog now defaults to true, so revealed tools are appended instead of rewriting the cached prompt.
A delegated GPT-Live reply ends at Live's next pause after the backend answers, rather than mid-sentence.
Harness LLMReminder now defaults to interval=10 instead of generating on every request.
MistralModel imports on fresh installs after requiring mistralai>=3.1.0 and dropping the legacy httpx import.
WebSearchTool and WebFetchTool are no longer offered on AsyncAnthropicBedrockMantle because that integration rejects them.
Adds monty_sandbox, accepting a remote Monty URL or a function that builds the pool.
Broadcast branches now start in .to() order instead of reversed; this can break replay of durable workflows paused across the upgrade.
An id-less URL MCPToolset uses its hostname as its id.
Stores the summary as a CompactionPart instead of a system prompt; provider-less CompactionParts are sent to every model.
Realtime shared settings now warn, raise, or ignore like standard ModelSettings; forced tool_choice raises on Gemini Live.
Hosted MCP capabilities prefix tool names with the service by default; the prefix is configurable.
Prohibited lists now reject hostnames that browser-use would match by exact hostname.
A file in a tool return now raises
NotImplementedErrorinstead of being silently dropped.Redacts the user's own prompt and closes fail-open paths in guardrails.
Azure Responses API prompts blocked without content_filter_result now raise ContentFilterError.
Raises a clear UserError on Trio before making any E2B request.
Rejects auth='oauth'.
The default capability ID is derived only from the server hostname; multiple servers on one host require explicit IDs.
Embedding models now raise model error categories such as ModelRateLimitError.
The prefect extra now requires prefect>=3.9.0 so it imports on current FastAPI.
Request-level instructions are stripped from untrusted history and client-supplied TextContent metadata is dropped from user prompts.
Harness-added user-channel content is summarized as <harness_data> rather than as user messages.
Frames results as
<tool_result>tool output instead of untagged user text.CodeMode run_code now returns the value of BackgroundTools tools it calls instead of a started message.
Raises when model_id is overridden for elevenlabs_agents_llm in ElevenLabs Agents Realtime voice mode.
Raises when model_id is overridden for elevenlabs_agents_tts in ElevenLabs Agents Realtime voice mode.
Removed this shut-down Groq model.
A realtime session is no longer recorded as ended when a tool raises; the session goes on.
Escapes tool names in discovery announcements and no longer recognizes announcements by their text.
Events are emitted after store reads so DBOS recovery with an event_stream_handler replays in order; existing workflows may not recover after upgrading.
A GPT-Live connection drop without a reconnect policy raises RealtimeError instead of a raw websockets exception.
Now aligns with the exchange boundary that wait_for_reply() waits for; use PartEndEvents to react when a particular response ends.
Raises instead of returning a response when a model request hook rejects with ModelRetry.
A resumed 'suspended' response's usage is counted only in the run that produced it.
Native tool_search is no longer granted to this model.
BrowserUse now runs on the host model by default.
Exa payment-required errors are propagated instead of retried.
A 200 response with a text/plain body from OpenAI Responses, Anthropic, Groq, or OpenAI images now raises ModelAPIError.
WarnNearLimits has been removed from the harness Coder capability.
A deleted Sprite now raises WorkspaceUnavailableError during a command regardless of its exit code.
Raises
ModelHTTPErrororModelAPIErrorinstead of anExceptionGroup, and maps botocore transport errors.Prefixes tool names with
logfire_.Every package now requires Python 3.11 or newer; Python 3.10 installs resolve to 2.54.0 and earlier.
Responses no longer include the empty
moderationstub.A
max_durationerror ends the session instead of reconnecting into the same limit.An unexpected tool exception ends the run, matching sequential tool behavior.
Model errors are re-raised in workflow code with their original type.
Hooks now enclose complete stage lifecycles.
Takes a slot on every call, even when called by the same task.
A model wrapper now raises UserError when it shares a limiter with the requesting agent or an enclosing model wrapper.
Raises this error for a thinking-only response refused by the content filter, instead of retrying.
Replaces
ModalSandboxSessionas the Modal sandbox backend, with harness tools running through a Modal workspace.Raises
ModelAPIErrorinstead ofValidationErrorwhen a stream drops mid-response.Renames
resolve_prompt_cache_retention()toresolve_cache_retention().Stops loading agent files by default.
Reject
google_affective_dialogon Gemini 3.1 Flash Live and 3.8 Live at connect.Raise
RealtimeErrorfor Gemini Live close codes.Raise a
UserErrorwhen realtimetool_choiceforces a tool call on OpenAI, Azure OpenAI, or xAI.Introduces a base for UnfillableRoute, renamed from ToolCallProposed.
The messages now end with the request being routed.
Offers an unfillable output_type as a route beside other routes and renames ToolCallProposed under the DecisionHandOff base.
Raises when content is not a string or sequence instead of silently sending a dictionary’s keys.
A capability durable operation called from a per-request hook is dispatched instead of silently running inline.
UI adapter requests must include a JSON Content-Type.
Invalid approvals values are now rejected.
Rejects per-run capabilities on DBOS, matching Temporal.
pydantic-ai v2.33.0 requires and supports anthropic>=1.0.0, avoiding runtime failures when that SDK version is installed.
When supplying a custom http_client, use an httpx2.AsyncClient; the 1.x SDK rejects legacy httpx clients at construction.
The workflow now fails on UnexpectedModelBehavior and FallbackExceptionGroup under the deprecated TemporalAgent.
Rejects calls from synchronous callbacks inside agent runs, preventing this unsupported usage.
Native structured output is denied for Claude Sonnet 5 and Fable 5 on Bedrock.
The local dev web chat validates Host against localhost, loopback, and LAN addresses by default; deployments using a real hostname must opt in with allowed_hosts.
A deferred tool must be revealed and its capability loaded before it can be called.
The web UI chat endpoint now requires Content-Type: application/json and rejects other requests before parsing the body or running the agent, preventing cross-origin requests from triggering tools.
An OpenRouter model that omits its provider prefix now raises a
UserError.Pydantic AI: Unbounded memory use when downloading remote content via web_fetch or FileUrl
Vercel AI's
ToolApprovalResponded.approvedfield is now aStrictBool.TemporalDurability rejects unknown ActivityConfig keys.
Raises UserError when a history processor or fallback_on handler has unresolvable type annotations.
HookTimeoutError and FallbackExceptionGroup fail the workflow instead of retrying forever.
Rehydrates sets, carries conversation_id, and errors on omitted fields.
Durable runs reject unregistered Model instances instead of re-inferring them from model_id.
Moves
openai_moderationtoOpenAIChatModelSettings.Removes this shut-down Gemini model.
Removes retired models and restores Gateway-supported models in KnownModelName.
Disables document input for AlibabaProvider when using the Chat Completions API.
The deprecated Bedrock gateway model is excluded.
Non-positive
OnlineEvaluator.max_concurrencyvalues are rejected.Non-object agent specification inputs are now rejected.
Separates the AG-UI representation opt-in from inbound uploaded-file security.
Splits inbound file security from the AG-UI representation opt-in, allowing uploaded files to be controlled separately.
Drops the redundant description from ToolSearchMatch.
A model name without a provider prefix now raises
UserError; supply a prefix such asopenai:.Replaces tool_retries= and output_retries= with retries: int | AgentRetries.
Agent behavior configured through several V1 arguments now uses composable capabilities for tools, hooks, instructions, and model settings.
Use
Agent.parallel_tool_call_execution_mode('sequential')in place ofAgent.sequential_tool_calls().Use
async with agent:in place of the removed server-running method.Run methods and override now configure output retries with
retries={'output': N}instead ofoutput_retries=N.Generic defaults for
Agent,RunContext, andToolchanged fromNonetoobjectwhen dependencies are not actuallyNone.Replaces the HTTP client cache with create_async_http_client and a context manager.
The listed
Dataset.evaluate()andevaluate_sync()arguments are now keyword-only.A name is now required when constructing a
Dataset.The default changed from
'early'to'graceful', so function tools requested alongside a successful output tool now run instead of being skipped.Enforces the deps type on FunctionToolset.tool through a tool/tool_plain split.
Run spans now report token usage under
gen_ai.aggregated_usage.*; setuse_aggregated_usage_attribute_names=Falseto retain V1 names.Use
google:in place of thegoogle-gla:model prefix.Use
google-cloud:in place ofgoogle-vertex:andvertexai:.Google Vertex provider integrations now use
pydantic_ai.providers.google_cloud.GoogleCloudProvider.The Google GLA provider is now
pydantic_ai.providers.google.GoogleProvider.Use
Graph.render()to render diagrams;pydantic_graph.mermaidwas removed.Import
GraphBuilderfrompydantic_graphinstead ofpydantic_graph.beta.The default instrumentation version is now 5; versions 2–4 still work but warn, and the listed V1 settings were removed.
MCP(url=...)now runs the server locally; setnative=Trueto retain the V1 remote behavior.Per-transport MCP server classes are replaced by one toolset whose transport is inferred from its arguments.
Use
merge_profile(profile, other)in place of callingprofile.update(other).ModelProfileand its subclasses are nowTypedDicts, changing how developers read, mutate, merge, and check profiles.Use
provider_detailsin place ofvendor_details.Use
provider_response_idin place ofvendor_idandprovider_request_id.This profile field is a sequence of setting names to drop, replacing the V1 boolean that covered sampling settings as a group.
The
openai:model prefix now selects the Responses API; useopenai-chat:for Chat Completions.system_prompt_roleis now configured throughOpenAIModelProfilein the model profile rather than as a model argument.A prepare callback must return
[]to strip all tools; returningNonenow raisesTypeError.A bare install now includes fewer extras; add the provider or integration extras your project uses.
The Google GLA provider import path changes from pydantic_ai.providers.google to pydantic_ai.providers.google_gla.
The Google Vertex provider import path changes from pydantic_ai.providers.google_cloud to pydantic_ai.providers.google_vertex.
Importing common removed names, or checking them with hasattr() or getattr(), raises an ImportError naming the replacement and linking the migration page; detect versions with try/except ImportError.
run_stream_events()must be used as an async context manager before iterating events.Use
RunUsagein place ofUsage.sequential=Trueis now a per-tool barrier rather than a batch-wide serial switch, and also applies to output tools.The streamed response API replaces
stream_structured;stream_response()yields bareModelResponsevalues rather than(response, is_last)pairs.Usage token fields are now named
input_tokensandoutput_tokensinstead ofrequest_tokensandresponse_tokens.Usage limit arguments now use
input_tokens_limitandoutput_tokens_limitinstead of request and response token limits.Web fetch is native-only by default; set
local=Trueto use the local implementation.Web search is native-only by default; specify
local='duckduckgo'to use the local implementation.Use
xai:in place of thegrok:model prefix.Grok provider integrations now use
XaiProviderand the XAI model APIs.
Security 49
Adds secret_env to Shell and masks the injected secrets in tool results.
Fixes quadratic-time ANSI escape removal when strip_ansi=True, preventing attacker-influenced tool output from occupying the event loop for tens of seconds to minutes.
Tool-schema reference inlining is protected against crafted schemas that could cause exponential time and memory use.
The local web-fetch tool checks domain allowlists before DNS resolution, preventing refused hostnames from reaching a nameserver.
Tool argument schema references are handled without repeated exponential expansion, protecting against crafted schemas that consume excessive time and memory.
Embedding spans no longer record the
extra_headersandextra_bodysettings, preventing credentials in those settings from being exposed in exported traces.URL downloads now block Tencent Cloud's instance metadata address, protecting temporary role credentials when local URLs are allowed.
Reloaded tool results that resemble serialized file types are no longer rebuilt as files, preventing unintended URL or object access using application credentials.
Egress policies check domain allowlists before DNS resolution, preventing refused hostnames from reaching a nameserver.
Local URL downloads now block Tencent Cloud's instance metadata address, protecting temporary role credentials.
JSON responses are no longer re-indented on the event loop before the returned-content limit is applied, preventing excessive memory use and event-loop delays.
Adds security scanning for agent Memory and Skills artifacts.
allowed_patterns is enforced against the real path when a single symlinked file is searched.
Redacts URL-encoded forms of secrets from
browse_webresults.Redaction also rewrites the history prompt when the model was sent a copy.
Shares one container inside
async with agent:and closes service-list bypasses andaws configurewrites to~/.aws.Keeps secrets on allowlisted sites and out of tool results, and fixes allowlist and file:// gaps.
Matches denied and read-only patterns case-insensitively, protects .git files, and bounds reads and Python regex searches.
Refuses reads of non-regular files.
Steering is sent as a SystemPromptPart note and judge feedback as escaped <judge_feedback> data, both marked with metadata; the steering note is tied to its frame with a ref.
Fixed HTML conversion that could delay unrelated work when web_fetch_tool fetched attacker-controlled HTML containing many elements.
Provider-native MCP configuration no longer exposes server URLs, authorization tokens, or custom header values in OpenTelemetry request traces; URL-based MCP capabilities also no longer expose URL-embedded credentials in identifiers.
Vercel AI and AG-UI adapters no longer execute available tools with client-chosen arguments when server-side message history is non-empty and the system prompt is server-managed.
Requests made through MCPToolset with a supplied HTTP client now apply auth, and the user-supplied client is no longer closed.
Prevents commands from running code on the SSH host through shell startup files or the SSHWorkspaceBackend stop script's PATH.
Refuses a root owned by another user.
Custom implementations must allow release() from a task other than the one that acquired the slot.
Prevents planted files from escaping the sandbox on the next launch.
Fixes streamed requests retaining concurrency slots and blocking other requests sharing the limiter after early exits or fully consuming debounced stream_text().
Adds a sandbox harness capability; file methods are sandboxed and sockets are blocked when networking is disabled.
Applies default read-only patterns to nested
.envand.git/paths.Pydantic AI: Excessive resource use when local web fetching converts nested HTML
Fixes an IPv6 zone identifier bypass of cloud-metadata and private-IP blocklists when local network access is allowed.
Fixes OpenTelemetry spans carrying exceptions, error statuses, instructions, and the output template when
include_content=False.With content inclusion disabled, spans no longer carry exceptions, error statuses, instructions, or the output template.
Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv6 zone identifiers
Fixes superlinear HTML conversion and charset decoding that could let one attacker-chosen page stall every agent in the process.
Fixes domain-list comparisons so a blocked domain cannot be reached using another spelling.
Fixes superlinear response processing in HTML conversion and charset decoding that could block the event loop.
Cookies are now scoped to original hostnames when using safe_download.
The local dev web chat UI validates the Host header against localhost, loopback, and LAN addresses by default, preventing DNS rebinding from reaching the served agent.
Retry-prompt content is now redacted when include_content=False, including retries not tied to a tool call, preventing information disclosure.
Pydantic AI OpenTelemetry instrumentation: retry prompt content is not redacted when
include_content=FalseFixes credential scoping and an ADC authentication environment-variable leak.
Redirect credential handling compares the full origin rather than only the hostname.
Fixes ALLOW_MODEL_REQUESTS guards for embeddings.
Adds Model Armor support for Google Cloud through
GoogleModelSettings.Non-crypto hashes are marked usedforsecurity=False as a FIPS precaution.
Adds inbound message-history hardening and fixes a vulnerability on the AG-UI serving path that could re-expose an unresolved tool call for execution.
Deprecations 19
Deprecates DEPRECATED_ANTHROPIC_MODELS, which Pydantic AI no longer uses.
Deprecates api_key in favor of auth.
The
Advisoroption is deprecated in favor ofnative=andlocal=.Renames fields to *_count, *_name, duration_ms, and previous_item; old names remain deprecated aliases.
Task-control events use Event-suffixed, past-participle names and gain agent_name and parent_task_id fields; old names remain deprecated aliases.
Deprecates cache_ttl.
Deprecates monty_sandbox_url in favor of CodeMode(monty_sandbox=...).
Realtime shared settings now warn, raise, or ignore like standard ModelSettings; parallel_tool_calls=False warns.
Deprecated on
GoogleRealtimeModelbecause no Gemini Live model supports it.Deprecated; OpenAIDecisionsModel can now take OpenAIProvider.
Deprecated in favor of ToolReturnPart with outcome='retried' and RetryFeedbackPart.
This API is deprecated.
Deprecates
inherit_tools.Deprecates fallback_model in favor of fallback_subagent_model.
Deprecates available_capability_ids in favor of active_capability_ids.
Deprecates capability_loaded in favor of capability_active.
The Exa search common tools are deprecated in favor of the ExaSearch capability in Pydantic AI Harness.
Deprecates cerebras_disable_reasoning.
Deprecates method-style result.usage() in favor of the property-style result.usage.
New APIs and options 405
Adds a setting for Anthropic message threads to specify the previous message ID.
Adds metadata to ConversationRecord, set with ConversationStore.update().
Adds title to ConversationRecord, set with ConversationStore.update().
Adds a capability to provide an agent today's date or the current hour in a chosen time zone.
Adds validated_args so an approver sees the arguments a deferred tool call will run with.
Adds a harness capability to answer deferred calls.
Keeps unattended runs working until a caller-defined completion check passes.
Supports Gemini 4 Neon (gemini-4-neon).
Tells the model when earlier assistant turns came from another model.
Adds routing of agent runs with ModelRouter.
Adds Otari as an OpenAI-compatible gateway provider.
Adds rules in Harness Permissions to allow, ask about, or deny tool calls and shell commands.
Tells the model how much of its usage limits and spend budgets is left on every request.
Tells the model when workspace files it read change or are deleted.
Sends an unhandled tool exception to the model as a failed tool result instead of ending the run.
Sends a coding agent back to run its checks when it tries to finish after an unverified edit.
Adds auth to StackOne to match other hosted MCP capabilities; api_key is deprecated.
Adds a provider for the Stav European inference gateway.
Keeps the tool list fixed behind tool_search, tool_describe, and tool_call so the prompt cache holds for large or changing tool sets.
Adds grep_tool_result for ToolOutputLimits spills.
Adds unit='bytes' reads for ToolOutputLimits spills.
Adds a harness capability to end a run with a final answer instead of UsageLimitExceeded.
Temporal activity-only workers can skip child workflow registration.
Includes the failed run's conversation; capture_run_conversation() can capture it so a failed turn can be stored.
Adds a request part describing what a capability tells the model, rendered before any model sees it.
Keeps nested scopes out of the Memory file listing.
Lets a parent inspect a running background delegation with check_task and a snapshot.
Adds support for the OpenAI gpt-6.2-sol and gpt-6.2-astra models.
Adds Hugging Face log-probability settings and returns logprobs in provider_details.
Can resume a finished sub-agent task.
Lets the model replace a tool result it just received with a summary.
Nested traversal can skip node_modules, .venv, and other package directories.
Adds a capability to retry the same model on transient model API errors.
Loaded skills can expose bundled files with read_files=True and substitute ${SKILL_DIR} placeholders.
Screens each streamed text, thinking, and tool-call part before the caller sees it.
Adds on_model_error= to choose retry or return for a failed sub-agent separately from on_failure.
File input can be judged by media type using supported image, audio, and video media type lists.
Adds durable to run a tool outside its durable unit on every durable execution engine.
Adds a tools selector for pre-search deferral.
Accepts
native=andlocal=like otherNativeOrLocalToolcapabilities;modeis deprecated.Can take a callable so a consultation budget can span several runs.
Adds an Anthropic data-residency setting.
Adds
authorityandpath_authorityto sandbox andSSHWorkspacecapabilities.Adds
DynamicWorkflow(call_scheduler=)to decide when sub-agent calls start.Adds
os_policy=to set the sandbox clock and time zone.Adds
Coder(autonomy=...)and trims the default instructions.Lets subclasses customize how sub-agent calls are scheduled.
Supports Gemini 4 Hydrogen (
gemini-4-hydrogen).Adds opt-in recursive node registration.
Adds
service_tiersupport.Adds a way to find retries in message history.
Adds
SubAgent(keep_partial_output=)to pass the sub-agent's last text to the parent when its timeout or usage budget stops it.Adds a MiniMax model profile used for MiniMax models on Bedrock and the listed providers.
Adds a profile setting to pair replayed tool-search calls and results when an API rejects unpaired calls.
Adds a model setting for the OpenAI safety identifier.
Adds a model profile flag to generalize response-scoped tool call IDs.
Answers over-budget and repeated tool calls instead of raising.
Adds the conversation_store option for loading and saving UI adapter conversations.
Adds a store for loading and saving UI adapter conversations.
Deferred calls are marked with kind and answered_by.
Adds a method to discover delegation tasks.
Adds a backend for the Gemini Decisions API.
Adds an exception for responses cut off at max_tokens.
Adds the RefineOutput harness capability.
Adds a way to ask for approvals and answers inside a run.
Supports running delegations to durable delegates as Temporal and DBOS child workflows.
Adds a per-command cwd to Workspace.run.
Adds
child_workflowtool metadata for running tool calls as DBOS child workflows.Adds support for Claude Fable 5.2.
Adds support for Claude Mythos 5.2.
Adds a way to change a message queued with
enqueuebefore delivery.Adds a
clientparameter.Adds a setting that controls framing announcements; the
<system>voice tag is announced only once a conversation needs it.Adds support for Gemini 4 Carbon on
GoogleModel.Lists Claude Fable 5.2 on Bedrock and sends per-message effort to it on OpenRouter.
Adds support for this OpenAI image model.
Adds a capability for keyless web research.
Adds the Bedrock model names
gateway/bedrock:global.moonshotai.kimi-k3andgateway/bedrock:global.moonshotai.kimi-k3.1.Adds a
clientparameter.Adds a profile setting to handle special tokens in content on open-model routes by breaking them up and restoring them in model output.
Keeps Chat Completions response data that Pydantic AI does not map.
Supports OpenAI
fastandultrafastservice tiers.Caps inlined nested instructions at 32,000 characters per conversation by default.
Adds
walk_upfor walking up directories when locating repository context.Adds a way to change the priority of a message queued with
enqueuebefore delivery.Supports
task_controlunder Temporal and DBOS durability.Supports the Anthropic web fetch tool through
provider_settings.Supports the Anthropic web search tool through
provider_settings.Adds per-path workspace authority lookup.
Adds Azure Durable Task durability to
pydantic_ai_harness.Lets server instructions be left out of the agent's instructions.
Adds OpenSandbox support for self-hosted agent workspaces.
Adds Pixeltable tools and memory storage to Harness.
Adds RenderSandbox support for running agent workspaces in Render sandboxes.
Adds a
retriesfield to configure summarization compaction retries.Adds
Workspace.authorityandAuthorityWorkspacefor workspaces whose files the operator does not control.Adds a setting for configuring
allowed_callerson Anthropic web tools.Adds a revision field to catch conflicting conversation saves.
Adds a store for keeping a conversation as a log of messages stored once.
Supports
'12h'prompt cache retention for GPT-5.6 and later.Adds WebSocket transport for OpenAI Responses.
Sends mid-conversation system prompts natively on OpenRouter OpenAI routes and supported Claude models.
AskUser answerers can now receive RunContext.
Adds a workspace that runs Coder, Shell, FileSystem, and other harness capabilities in a boxd machine.
Function evaluators are saved to Dataset files under the function's name.
Adds a model setting so a stream that never starts can fall back.
Online evaluation result events now include the scorer run ID attribute.
Online evaluation result events now include the scorer score type attribute.
The sticky option keeps a conversation on the fallback model that answered.
Adds a fallback capability, constructible from agent specs, for moving to another model when an attempt fails.
Records which model the agent sent each request to.
The dynamic system prompt decorator can append changes to keep the cached prompt.
Reports word timing for realtime speech on Azure AI Voice Live and ElevenLabs Agents.
Adds a per-attempt hook for preparing model requests.
Adds conversation-scoped harness reminders that stay in the message history.
Adds RetryModelRequest for use with model fallback and per-attempt request preparation.
Loads on-demand capabilities from code.
Support is added for ag-ui-protocol 1.0.
task_timeout bounds the duration of each evaluation task attempt.
A capability is available to interrupt repeated-action loops.
Gemini Live reconnect replay is passed to dial as a keyword-only replay argument.
The OpenAI gpt-6.1-terra model is now supported.
An IPython-based Code Mode is available alongside the Monty-based CodeMode.
UI adapters can use manage_message_history to avoid sending server-held history to the model twice.
Harness SpendLimits budgets can now be shared through PostgreSQL using PostgresSpendStore.
A public framing module provides wrap, neutralize_tags, and register_tag so extensions can frame their own tags.
Restricts tool_choice subsets on OpenAI Chat Completions while preserving the prompt cache.
Adds on-demand native message compaction for Anthropic models.
Adds a capability for provider batch API support.
TemporalDurability can run tool calls as child workflows using tool metadata.
Adds task_control to turn on SubAgents task control.
Lets the model request harness compaction at a natural break in the task.
OpenAI and Anthropic can change thinking effort mid-conversation; the change is recorded as a ModelSettingsDeltaPart.
Exports this helper from pydantic_ai.durable_exec for third-party durability engines.
Adds a capability hook for provider batch API support.
Adds a model error category for authentication failures.
Adds a model error category for models that cannot be found.
Adds a model error category for rejected requests.
Changed MCP server instructions can be appended, with instruction blocks cached behind a second cache point after static instructions.
Adds StructuredContent as user content, sent as its value to decision models.
Enables delegations to run as model-controllable background tasks that can be steered, answered, or cancelled.
Adds tool_prefix to the MCP capability to configure hosted MCP tool-name prefixes.
Hosted MCP capabilities now accept asynchronous auth functions.
Accepts
transport=; httpx2 retry transports now receive their pool limits.Adds the
kimi-k3.1-promodel name.Adds the
kimi-k3.1-pro-highspeedmodel name.Adds a WebRTC URL that carries
webrtcfilter=onon Azure OpenAI.Adds an audio-output capability flag so text-only realtime models default to text output.
Bounds background and shell job logs with a configurable maximum byte count.
Adds structured citations to text parts.
Adds a local BoxLite micro-VM workspace capability.
Adds a harness capability that runs the workspace in a local Docker or Podman container.
Adds the FileUnderstanding capability.
Adds lockdown to ask GitHub's server to withhold public content from users without push access.
A named instruction passed to a run can opt into on_change='append', keyed as run:<name>.
Accepts auth and headers as functions of run context, allowing each run to connect as its own user.
Opt in to recording who wrote a memory file through MetadataMemoryStore and Memory(write_metadata=...).
The context now includes usage limits, deadline, run and conversation identifiers, plus output retry count and budget.
Adds base_url and MOONSHOTAI_BASE_URL support.
Adds compaction that keeps, reduces, or drops older history steps according to a judge model's ranking.
Adds a harness capability for plain-English code search with a pluggable judge model.
Can now use a VM that the application already has.
Adds model profile flags for audio-file input and supported document media types; unreadable returned files are sent as notes.
Supports Temporal continue-as-new through continue_as_new.
The unified thinking effort levels now include 'max'.
Every mid-run change to tool population is now recorded as a ToolAvailabilityDeltaPart.
Adds unless_tool_kind to ToolDefinition and tool_name_for_kind to RunContext; instructions also receive the current step's tools.
Added an event so a realtime reply settles only with the response that answers it.
Added a workspace that runs Coder, Shell, FileSystem, and other harness capabilities in a Daytona sandbox.
Added a model for Eleven Realtime speech-to-speech models.
FileSystem tools now have registered tool kinds and typed call parts.
Can send a configurable copilot-integration-id via
integration_idorGITHUB_COPILOT_INTEGRATION_ID.Added a provider-neutral model error category.
Added
for_categoryto construct a ModelHTTPError for a provider-neutral model error category.Added provider-neutral model error categories.
Added
on_change='append'to preserve dynamic instruction prefixes; FunctionToolset.instructions and instruction functions can opt into this behavior.Added a lifecycle event recording what the user heard of ElevenLabs Agents replies they barged in on.
Added
non_retryable_model_errorsto stop Temporal retrying specified model error categories.Added a warning for unavailable usage limits, distinguishing omitted provider usage from reported zero.
Steers a running delegated task.
UI adapter dispatch_request() accepts timeout=.
Runs realtime sessions on ElevenLabs Agents.
Sets how many times the provider SDK retries a request.
Sets a timeout covering all attempts and stream consumption of one model request.
Adds a provider that lets app users sign in with ChatGPT and use their plan.
Deletes answered tool rounds from the OpenAI Realtime conversation.
Requests reasoning summaries from the GPT-Live backend.
RealtimeConnection yields lifecycle events through this public module.
UI adapter run_stream_native() accepts timeout=.
UI adapter run_stream() accepts timeout=.
Provides the deadline for a run bounded with timeout=.
Set unknown_names='skip' to ignore include and exclude names that no library has.
Request-scoped system prompts are sent natively as Anthropic clear_at system messages.
Bounds a whole agent run.
Any module can define a ToolKind with typed tool parts, and unknown kinds remain loadable.
Adds a Harness reviewer that lets a model approve low-risk tool calls before a person sees them.
Adds dataset_name to EvaluationReport.
Adds a method to relay MCP Apps tool calls.
Adds read_resource_contents and forwards MCP Apps tool results to AG-UI and Vercel AI frontends.
Adds MetaProvider for Meta Muse models, with meta: using the Responses API.
GoogleModel supports Gemini 4 Argon, including long decode past the per-request output cap.
Adds PGTaskDurability based on pgtask for durable task execution.
Adds an integration for Render Workflows with Durable Execution engines.
Skills can layer project and personal libraries, name each skill's directory, and render a skill for a host command.
Adds a workspace that runs harness capabilities in a local smolvm microVM.
ZaiProvider accepts a
base_urlargument, allowing the provider endpoint to be set.Seeds
message_historyinto a WebRTC call.Supports configuring semantic VAD, end-of-utterance detection, noise suppression, and echo cancellation.
Adds a unified setting and
Cachingcapability for cross-provider prompt caching.Adds support for this model.
Carries and stores a conversation between runs and is accepted as
conversation=by every entry point.Adds support on Bedrock Converse.
Ends a WebRTC call from the server on gpt-realtime and GPT-Live.
Places a prompt-cache breakpoint on the instructions.
Allows text-only GPT-Live sessions to work without a microphone.
A new backend supports image input.
Adds a hosted Postgres backend for media.
Adds a hosted Postgres backend for messages.
Records prompt-cache diagnostics; enabled by default for OpenAI Responses, with
anthropic_cache_diagnosticsas an opt-in.Span attributes report prompt-cache health per conversation, and events are collapsed.
Bounds retained realtime audio, like retained images.
Adds a dedicated warning category for CodeMode's missing-return-schema warning.
Adds native to prefer the model's native web search.
Adds a web_search_tool factory for WebSearch(local=...).
Works on OpenAI GPT-Live through its delegated backend.
Adds AbsurdDurability to the harness as a replacement for pydantic-ai-absurd.
Questions can be deferred to the host, and slow answers can time out.
Exposes the message-history repair pipeline.
Adds a model for running decision models such as CLM and Laya over the /v1/systemone API.
Generated data now supports oneOf schemas.
Adds an API to assess tool calls before execution.
Supports browser WebRTC on OpenAI GPT-Live with a sideband session.
Models realtime asynchronous tool calls as a profile setting, alongside the shared
async_tool_callssetting.Adds an Azure AI Voice Live temperature setting.
Selects an Azure voice for Azure AI Voice Live sessions.
Adds support for Claude Sonnet 5.5.
Provides tools one API for files and commands across local machines and sandboxes, with durable execution support.
Adds a default cache-retention profile setting.
Adds a workspace that runs harness capabilities in an E2B sandbox.
Delivers images and text files returned from tools.
Allows image output on this model.
Adds support for the OpenAI gpt-6.1-sol model.
Emits identified response, turn, and input lifecycle events.
Adds a hook for processing provider details.
Accepts
mxfp4,nvfp4, andmxfp8quantization values.Accepts
exactoas a sort value.Adds a helper for the prompt-cache cold window.
Adds a workspace that runs harness capabilities in a Fly.io Sprite.
Adds an SSH workspace harness capability.
Add OpenAI GPT-Live support with
OpenAILiveModel.Replaces the decision model's tool-call lean with an opt-in threshold.
Adds DecisionModel as a base for Decisions-protocol models and makes TypeSafeModel one.
Adds realtime support for this Gemini model.
Adds the routed request as a prompt on the model selection context.
Adds audio duration usage so duration-billed voice models can be priced.
Lets hooks detect when they run in durable workflow code.
Exposes OpenAI service_tier in provider details.
Adds a way to specify what a bool field's yes and no mean, including through a True/False Enum.
Offers whole-number choices that are not a rubric in TypeSafeModel.
Adds device authorization for GitHub Copilot OAuth.
Adds RealtimeSession.wait_for_reply().
Adds support for Claude Opus 5.5.
Adds support for the OpenAI
gpt-6-lunamodel.Adds support for the OpenAI
gpt-6-solmodel.Adds support for new OpenAI audio models.
Adds a helper for a set of described options built at run time.
Adds a profile field and allows LLMJudge and GEval to run on a model without text output support.
Adds a method to wait for playback to finish before closing a realtime session.
Adds a topic for streaming agent events via Workflow Streams.
Adds a threshold for deciding when a yes/no answer counts as True.
TypeSafeModel can fill a tool's arguments when Jev can express them.
Enums mixing in this helper describe their options using their member docstrings.
Adds TypeSafeModel for TypeSafe's Jev.
Emits an event when a realtime session delivers enqueued content.
Adds a first-run banner describing the run and opens clai sessions with it.
Adds a provider for GitHub Copilot's OpenAI-compatible API.
Adds a direct image generation API.
Adds a provider for ChatGPT/Codex subscription authentication.
Adds
RealtimeSession.enqueue()for out-of-band prompts from code driving the session.Adds
handle_barge_in=Trueto handle barge-in in the session.Adds
provider_factorytoinfer_realtime_model.Adds the
played_bytesparameter for handling barge-in in the session.Adds
@agent.on_eventfor registering event listeners on anAgent.Adds
played_audio_bytesfor handling barge-in in the session.Adds an API to update prices in the background.
Adds
respond=toRealtimeSession.send(); a text turn solicits a reply.Adds support for the OpenAI gpt-6-astra model.
UI adapter run methods now support
CancellationToken.Capabilities can emit typed events into the run event stream.
Adds support for the Claude Fable 5.1 model.
Adds support for the Claude Mythos 5.1 model.
Application code and capabilities can emit typed custom events into the run event stream.
Adds support for the
gemini-3.8-flashmodel.Adds
context_windowtoModelProfile.Adds a profile flag to reject streams that do not include
finish_reason.Adds support for
NativeOutputon DeepSeek's Responses API.Adds an event subscription decorator for run event streams.
Adds a provider for vLLM servers.
Adds glm-5.3-flash as a supported model.
Adds the @durable_operation decorator for capabilities; it requires an explicit operation name.
Instruction parts now have a stable ID.
The clai command supports --mcp-config.
Adds a public backend API for third-party durable execution engines.
send_audio() now accepts async iterables.
The clai command supports tool-call streaming.
Adds a skill for migrating from LangChain.
Adds support for GLM-5.3.
Instrumentation version 6 emits tool results under role: 'tool'.
Adds support for the xAI attachment search lifecycle.
AGUIEventStream now has its own thread_id and run_id.
A UIEventStream can now be built without a run_input.
Adds the gemini-3.7-flash model.
Use openrouter:web_search for web search.
Exposes gRPC metadata on XaiProvider.
Adds the
azure_voice_livesetting for Azure AI Voice Live.Adds realtime speech-to-speech support through Agent.realtime().
Adds browser WebRTC and server-sideband support for realtime speech-to-speech.
Adds the cerebras optional dependency group.
Adds the Crusoe provider.
Adds SnowflakeModel for Snowflake Cortex.
Adds SnowflakeProvider for Snowflake Cortex.
Adds xai_agent_count to XaiModelSettings.
Adds first-party run cancellation through AgentRun.cancel(), RunContext.cancel(), and RunCancelled.
Promotes the run_stream_events() iterator to a public handle with cancel() and run-state access.
Adds coverage and documentation for using DeepSeek V4 Flash via OpenAIResponsesModel and DeepSeekProvider.
Function tools can be hidden until revealed through tool search, load_capability, or ToolReturn.tools, using each provider's native deferral/addition channel.
Resolves effective prompt-cache retention from model settings.
Forwards xAI FileSearchTool collections search options.
Bedrock supports ModelSettings.extra_headers, allowing extra headers to be configured for Bedrock requests.
RunUsage now includes cost.
Adds ToolAvailabilityDeltaPart with native tool_addition and additional_tools rendering.
MCPToolset clients can use prefer_tasks to skip optional MCP tasks.
Adds is_tool_available for checking whether a tool is available.
Adds configurable max_retries.
Adds per_request_input_tokens_limit to UsageLimits so developers can limit input tokens per request.
Adds support for the Claude Opus 5 model.
Adds OpenAI Responses API reasoning.context support for the gpt-5.4, gpt-5.5, and gpt-5.6 families, defaulting to all_turns.
Adds headers to ModelHTTPError and populates it from all provider SDKs, making response headers available to developers.
Adds retry_after to ModelHTTPError and populates it from all provider SDKs, making retry timing available to developers.
AdvisorTool is now supported for Anthropic and OpenRouter.
A BedrockMantleProvider is added.
The location type accepts the multi-region locations 'us' and 'eu'.
WebSearchTool for OpenAI Responses gains the external_web_access option.
RequestUsage now supports arbitrary fields for upcoming genai-prices.
RunUsage now supports arbitrary fields for upcoming genai-prices.
Adds support for the
gemini-3.5-flash-litemodel.Adds support for the
gemini-3.6-flashmodel.Adds the
mistral_prompt_cache_keysetting for Mistral models.Passes
parallel_tool_callsto the Mistral SDK.Exposes Chat Completions moderation results in
provider_details.Adds an optional
run_id=to agent runs, durable wrappers, and UI adapters.Adds
ToolFailedfor model-visible failures that do not trigger retries.DynamicToolset is wrapped in DBOS steps and Prefect tasks.
Explicit prompt caching is supported for gpt-5.6.
Adds the openai_moderation setting.
OpenAI Responses API moderation results are exposed in provider_details.
Adds register_legacy_workflows to DBOSDurability for clean DBOSAgent migration.
The tool-retry budget can be overridden at run, iter, or override time.
Adds DBOSDurability as a durability capability to replace deprecated wrapper agents.
Adds PrefectDurability as a durability capability to replace deprecated wrapper agents.
Mistral supports reasoning_effort via thinking settings.
Adds TemporalDurability as a durability capability to replace deprecated wrapper agents.
Adds a property to RequestUsage and RunUsage for accessing the cache hit ratio.
Adds a capability hook for agents.
Adds a capability hook for getting a model.
Adds an instrumentation setting to omit the model_request_parameters span attribute.
Adds a capability to raise a content filter error for non-empty content filter responses.
Adds a capability hook for resolving a model ID.
Adds DeferredToolCallEvent to AgentStreamEvent.
Adds DeferredToolResultEvent to AgentStreamEvent.
Emits an event when enqueued messages are delivered into the run.
Adds the Moonshot AI kimi-k3 model.
HistoryProcessor is now exported for developers to use.
Adds support for OpenAI background mode.
GPT-5.6 models and reasoning mode are added for OpenAI.
Tools and capabilities can access the run's usage limits through RunContext.
The clai CLI adds a slash command for cumulative token usage.
to_cli() can pass model for agents without a set model.
Supports the azure-responses:[model-id] shorthand for specifying a model.
Adds the xAI grok-4.5 model.
Adds model profiles for Writer, Z.AI, and Moonshot AI, and refreshes
LatestBedrockModelNames.Adds files support for Anthropic and OpenAI code execution tools.
Streaming model requests now record time-to-first-token.
Adds an agentic span-based evaluator for argument correctness.
Adds the GEval evaluator and standard quality metric rubrics for LLMJudge.
Adds standard quality metric rubrics for LLMJudge.
Adds an agentic span-based evaluator for maximum model requests.
Adds an agentic span-based evaluator for maximum tool calls.
Adds an agentic span-based evaluator for tool correctness.
Adds an agentic span-based trajectory evaluator.
Adds a native Z.AI (Zhipu AI) provider with thinking support.
Adds support for the Claude Sonnet 5 model.
The lifecycle argument can now be a factory function.
Adds a retry_options parameter to GoogleProvider.
Adds prompt and completions cost fields to OpenRouter.
Adds Anthropic _20260209 web tools with server-tool replay.
Adds a TypeAdapter for EvaluatorContext.
Adds cerebras_clear_thinking.
Adds support for the gemini-embedding-2 embedding model.
Adds google_task text-prefix conditioning for gemini-embedding-2 embeddings.
Adds the groq_reasoning_effort setting.
Configure the output retry budget on Agent, run methods, and override(); agent specs also accept output_retries.
Configure output and tool retry budgets with a mapping; a bare integer sets both budgets. Agent specs accept an integer or a mapping with output and tools keys.
Configure the tool retry budget on Agent.
Adds the xai_max_turns model setting.
Performance 9
Makes the speculation scan of streamed code linear in its length.
Prefix filters can use an index.
Loading client-submitted messages no longer takes time proportional to the square of the number of parts, reducing event-loop delays.
Loading client-submitted messages no longer takes time proportional to the square of the number of parts, reducing event-loop delays.
Stores each message once instead of repeating history in every snapshot.
Stores each message once instead of repeating history in every snapshot.
The module is loaded only when an MCP capability needs it, halving
import pydantic_aitime.Validation no longer makes a Python call per JSON node.
OTel serialization is cached per message to avoid O(n²) instrumentation cost.
Behavior and default changes 116
Under CodeMode(tools='all'), approval-required and external tools remain native.
An HTTP 408 from a provider is raised as ModelTimeoutError.
SpendLimits budgets can resolve their usd or tokens ceiling per scope from the run context.
Harness FileSystem and Shell tools now run on Azure Durable Task and Render.
Can provision its CDP endpoint per run and attach to the default context.
Each flagged verdict is recorded as a prompt_injection flagged span.
Durability capabilities wait durably for a model error's retry_after before retrying a model request.
Forward service_tier to xAI and record the served tier in provider_details.
Settled sub-agent task histories stay in their saved files instead of every owner's memory.
Detects loops in streamed thinking, text, and tool call arguments.
Moves AskUser onto the deferred pipeline.
Uses the AI Gateway's streamed cost for BedrockConverseModel streams.
A CancellationToken fired from a workflow signal can cancel a Temporal durable run.
Uses the AI Gateway's streamed cost for GoogleModel streams.
Falls back to the next model when a response is cut off at max_tokens.
Runs semantic classification as durable operations so it works on Temporal.
Phrase matching strips default-ignorable characters and flags hidden variation selectors.
Documents can be sent for any media type known to
mimetypes, with the format inferred from it.Guardrail verdicts are recorded as durable operations.
Curates the known model names and provider model-name literals to models a user would pick.
Nested instruction files are surfaced when the model writes or edits in a directory.
Loads one instruction file per directory and nested files by default;
Coderbuilds on those instructions.Supports dynamic agents under durable execution.
Evaluations are checkpointed as a durable operation when the judge has an
id.When citations are requested, these web tools are called directly on the Anthropic API.
xAI Grok Voice speech timing is reported as
segmenttimestamps.Instructions are re-resolved before each model turn, and changes are delivered as appends.
Copies with
keep_user_messages=Trueare recognized only by the marker on their text.Sends Google a server deadline of at least 20 minutes instead of using the client's read timeout, and warns about httpx's 5 s default.
Falls back to the next model when a model refuses;
ContentFilterErrorinfallback_oncan match refusals.Tool results are paired with the response that made the calls.
json-repair is now optional and is needed only by Coder and RepairToolArguments.
Stored response, item, conversation, and container IDs are sent only to the endpoint that created them.
A retrying transport that gives up now raises ModelHTTPError, allowing model fallback to proceed.
Evaluators are dispatched once per durable run instead of on every replay.
Plain functions are accepted as evaluators.
Signed and encrypted history data is replayed to providers that use the same canonical_system.
A deferred CombinedCapability loads as one capability, while its members retain their global ordering.
Strict schemas stay within Anthropic and OpenAI complexity limits, with non-strict output used as a fallback when no mode was chosen.
Delivers ctx.emit() events into the realtime session event stream.
Uses the Pydantic AI Gateway's reported cost for RequestUsage.cost.
Delivers realtime SystemPromptParts on each provider's operator channel.
Harness SystemReminders are built on request-scoped system prompts.
OpenRouter keeps the prompt cache when thinking effort changes mid-conversation via its configuration_update system message.
Caps command output.
Citations from Bedrock, OpenRouter, and xAI are normalized.
Makes durable-engine operation types,
ParameterTransports,DurableRunContext, and run identity hooks public.Replays citations in message history to the provider that produced them.
Warns when a session has capabilities implementing hooks it never calls.
Warns when a provider-specific thinking setting from a broader scope overrides thinking.
For models that cannot turn thinking off,
thinking=Falsenow sends the least thinking the model accepts.AskUser and several other capabilities now have stable default IDs.
Defaults maxTokens to Claude's maximum output and streams requests of that size behind the scenes.
Appends the next hour to history instead of rewriting instructions, keeping the prompt cache.
The profile's supports_auto_cache decides whether automatic Anthropic caching is used; legacy AsyncAnthropicBedrock uses it for Claude Opus 4.7 and later.
Enqueued messages stream to Vercel AI and AG-UI frontends as history they send back but do not render.
WarnNearLimits warnings are sent as request-scoped system prompts.
With Temporal tracing enabled, pass an explicit id= to URL-based MCP after in-flight workflows complete; changing it renames the activities.
A native tool is treated as unsupported when the model cannot apply its domain, usage, or external web access settings.
Can return images and PDFs, and describes other binary files.
Warns when a model ignores settings such as timeout, max_retries, or stop_sequences.
BackgroundTools completions now receive namespaced origin and tool_call_id metadata.
Realtime history, usage, and reply waits now come from the session core.
Realtime history, usage, and reply waits now come from the session core.
Requests are priced at their reported service tier.
Browser-use telemetry is now opt-in.
The Google providers' default timeout is raised to 20 minutes.
Defaults to API version
2026-07-15and appliesparallel_tool_calls=False.Raises warning events as Python warnings instead of dropping them.
When
cache=True, Anthropic automatic caching also caches instructions and tool definitions.Prompt caching is on by default in harness
Coder.Each failed attempt is recorded with its model, timing, error, and usage; rejected responses are counted in
RunUsage.The HTTPX2 client factory is now public.
A second durable execution engine on an agent is refused before either engine binds.
Embedder instances are compared by identity.
The default input transcription model changes from auto to gpt-live-transcribe; gpt-transcribe is also listed.
Reconnects dropped sessions by forking a stored session or replaying history.
Default to the OpenAI SDK's connection pool limits.
Inventory is disabled by default.
Images and documents from tool results are now sent to the delegated backend.
Google grounding web search queries are now counted in usage.
Removes the default ACP request limit.
Defaults
max_tokensto the model's maximum output, streaming such requests behind the scenes.Raises the default from 4096 to 16384 on Claude Sonnet 4.5 and later.
File tools now have a retry budget of 5, and scratch files are kept out of the project.
Seeds retained user audio on this Gemini Live model.
Seeds retained user audio and seeds tool calls and results as native function parts.
Harness capabilities now work through
ctx.workspacein any workspace, locally or in a sandbox.Maps the shared
parallel_tool_callssetting to the GPT-Live backend model.Maps the shared
thinkingsetting to the GPT-Live backend model.Emits a decide span for every request a DecisionModel sends.
Routes are asked for by name, with one label per route.
Route fields are asked with the route question under a route premise; nested fields receive context, and tool calls are followed by a done state.
Uses the user's description of None as the “none of these” option.
Can answer three additional field types.
Can fill a union of output types by choosing the type first.
Provides a stable serialized shape, and finished streams settle into that shape.
One-off capabilities now receive a default id and a combine rule for repeats.
Reduces the default Temporal metric export frequency.
Invalid model identifiers now suggest known model names.
OpenRouter web-search sources are surfaced in provider_details annotations.
MCPToolset supports FastMCP 4 and MCP SDK v2 alongside FastMCP 3.
CompactionPart now round-trips through the Vercel AI and AG-UI adapters.
The stable Gemini Gateway alias is restored.
Gemini VALIDATED tool mode is now the default on supported models.
Mid-conversation system prompts are sent as native system messages on Anthropic.
Anthropic no longer advertises tool search for capability-owned deferred tools.
DynamicCapability toolsets are supported in durable execution.
Text-like files in MistralModel prompts are inlined.
Tool-retry errors now include actionable hints.
Usage-limit errors now include actionable hints.
Agent.to_web() targets sdk_version=7 and bundles chat UI 2.0.0.
Multimodal tool returns now round-trip through the AG-UI and Vercel AI adapters in history and streaming.
On Pyodide/emscripten, sync callbacks now run inline by default.
Maps AG-UI interrupts to DeferredTools.
Captured messages now include the partial request and response of an interrupted run, marked
state='interrupted'.
Fixes and other changes 753
Restores empty tool_args when Anthropic streams a zero-argument mcp_tool_use.
Skips Anthropic content blocks and deltas of unknown types, with a warning.
Preserves stale-thinking-block recovery for later counts when the request carries a ModelSettingsDeltaPart.
Remote CodeMode turns run as Temporal activities so long snippets do not trip the deadlock detector.
A deferred pause resumes by pausing again when its step ran other tools and deferred_tool_results are omitted.
Fixes wording for retained-audio and ImageUrl errors and gives session.send() WAV errors their own wording.
Attach errors cut every URL to its origin, not only the exact cdp_url.
Classifies Bedrock ModelErrorException and Groq 498 errors.
A lost Sprite create is sent again instead of only being looked up.
Closes the debounce generator when the consumer stops early instead of leaving it to the garbage collector.
Replaying xAI WebSearchTool calls keeps the stored function name.
Replays every input field so thinking after a search stays valid.
Expired-container and stale-thinking-block retries run for a status a retrying transport gave up on.
Preserves tool_plan in message history and replays it on follow-up requests.
Accepts any task ID when the owner has no directory.
Waits for pending parallel InputGuardrail verdicts before stopping a streamed request and checks long parts in linear time.
xAI upload file names now use extensions based on the downloaded media type.
A malformed frame now ends the response it closes instead of merging later replies into it.
Turns the reasoning field of responses into ThinkingParts.
Unknown IDs list valid IDs, and loading already-active capabilities is a no-op.
Re-runs get_instructions and get_model_settings for the model serving a fallback attempt.
Answers tool results and ends the response after an unreadable or id-less response.done.
No longer sends Responses reasoning item ids as assistant-message fields in auto thinking mode.
Raises ModelHTTPError for the relevant failed status.
For qwen/qwen3.8-flash, falls back to auto or raises ModelRequestRejectedError when forced tool choice is rejected during reasoning.
Sends tool-returned video only to models whose profile reads video; other models receive a note instead of a 404.
Checks model-written pin(source='model') bodies for lookalike frames.
Processes spilled payloads in chunks.
Keeps instruction files under a linked directory inside the scanned directory.
Dropped with a warning on Bedrock Converse models that reject the setting.
Include docstring admonition sections and whole annotated Returns sections.
Caches uploaded documents per model instance.
Keeps the body of an error status that the transport gives up on.
Ollama sends the setting as
max_tokens, notmax_completion_tokens.Anthropic tier spend caps and user-set spend limits raise this error.
Raises
ModelContextWindowExceededErrorwhen Ollama Cloud reportsexceeded max context length.OpenAIProvideraccepts an asyncapi_keycallable.Skips a tier that fails on model errors, and tiers can omit their trigger.
Sends the request's betas and raises its all-deferred-tools UserError.
Drops the account-age claim because Claude Fable 5.2 and Mythos 5.2 bind thinking blocks on every account.
A damaged saved task no longer prevents opened() from proceeding.
Completes a turn that ends silently after a tool result.
Lowers a value above a Claude model's maximum output to that maximum instead of sending it.
Honors remembered approvals inside durable execution.
Summarizes tail messages displaced by copied user messages instead of dropping them.
Maps unified thinking to reasoning_effort for Z.AI GLM and DeepSeek V3.2 on Bedrock.
Reports when tiers retain more than target_tokens and the target cannot be reached.
Resolves vendor/model IDs through one case-insensitive family map on OpenAICompatibleProvider, LiteLLMProvider, and TogetherProvider.
Carries ModelResponse.canonical_system through both event streams.
Anthropic beta headers from
extra_headersare merged with other betas regardless of capitalization.Anthropic client's
default_headersbetas are sent alongside Pydantic AI's betas.Builds off the event loop.
Renders keyword and non-identifier tool parameter and field names as valid Python in
CodeModeandIPythonCodeMode.Setup errors are raised to callers, timeout advice is corrected, and local and remote sessions reset after memory or output limits.
Stops commands under
crun1.14.1.A user-agent supplied through
extra_headersreplaces the built-in one regardless of header-name spelling on OpenAI, Anthropic, and Groq requests.A user-agent supplied through
extra_headersis sent as one header line on Google requests.Limits the total size of file URLs downloaded for one model request.
Sends
max_num_resultsto OpenAI Responses.Fresh installs keep
GoogleModelon thev1betaGemini API by cappinggoogle-genai<3.Renders keyword and non-identifier tool parameter and field names as valid Python.
Sends the setting to DeepSeek as
max_tokensrather thanmax_completion_tokens.Is populated from Gemini's
RetryInfo.retryDelay.Treats additional IPv6 prefixes as private addresses.
Is raised for Gemini daily quota and disabled billing, and for an exhausted Moonshot balance.
Replayed durable work is excluded from traces and token and cost metrics on AWS Lambda and Temporal.
Anthropic fast mode responses are priced at fast mode rates by recording this provider detail.
Sync runs no longer warn that there is no current event loop.
No longer raises
TypeErrorwhentimeoutis not a number.Tool search discoveries are retained across compaction by recording them again as a
ToolAvailabilityDeltaPart.Is announced for a background task that settles before
delegate_taskresumes, including on durable replay.Is retained on tool call arguments sent by the special-token restorer when a stream ends.
Fixes
ToolOutputfor gpt-oss onBedrockMantleProviderby not forcingtool_choice.The focus prompt takes user constraints only from the user's messages.
Code-loaded on-demand capabilities persist across compaction, and every removed load is recorded again as a
CapabilityLoadDeltaPart.A code-loaded capability's instructions are retained across instruction windows.
Adds streaming support for Cohere models.
Inlines
$defsin tool schemas for GLM-5.3 on the listed providers and OpenAI-compatible gateways.Instrumented embedding spans now include the
embeddingsattribute wheninclude_content=True.Approvals are rejected for tool calls that server-held history is not waiting on.
Stops failing with
AttributeErroron Modal 1.6, which removedFilesystemExecutionError.Earlier tool-call turns remain byte-stable when a later response thinks in
fieldmode.Repairs are written back to the
ToolCallPartin history.Connections are closed when a WAL switch fails on a locked database.
Extra keys in
tool_searchandload_capabilitymessage history are preserved.Raises
ModelContextWindowExceededErrorandModelQuotaExceededErrorfor the corresponding Bedrock errors.Treats
auth=''as unset, alongsideclient, in GitHub, Notion, Ordinal, PostHog, Pylon, and Slack.Forwards
cache='1h'to Claude Haiku 5.5 on Bedrock instead of changing it to'5m'.Includes refusal text when the provider also reports a finish reason.
Raises
ContentFilterErrorrather thanTypeErrorwhen Azure filters a streamed prompt.No longer retries subclasses of non-retryable errors, including
ContentFilterErrorandUserErrorsubclasses.Reads tool parameter descriptions from
Keyword ArgsandOther Parametersdocstring sections and retains*argsand**kwargsdescriptions.Capability specs can set the base fields id, description, and defer_loading.
Publishes schema fields for Advisor, SummarizingCompaction, ManagedPrompt, PyaiDocs, CodeMode, ModalSandbox, and Skills.
No longer rejects all-deferred tool requests and no longer undercounts server tools on the Anthropic API.
on_run_error, shielded capability cleanup, and model stream close run when an anyio scope cancels a run.
An asyncpg pool now type-checks as PostgresMemoryStore's PostgresPool.
Finished results remain in history when a run pauses for deferred tools.
Falls back from Native Output when the installed botocore predates outputConfig.
A stalled call or stream read stops waiting when its request is cancelled or times out.
Regex patterns rejected by Bedrock are stripped from strict JSON schemas.
The unified cache setting is enabled for GPT-5.6 and later with the Azure OpenAI v1 API.
Tool results end before a mid-conversation system entry so it is not read as tool output.
Bedrock AnthropicModel clients no longer advertise CodeExecutionTool.
Mixed tool-search corpora are searched with search_tools so native deferred tools no longer declare sandboxed tools.
Sub-agents run under the parent run's usage_limits instead of the 50-request default.
Can edit non-UTF-8 text files read by read_file while honoring expected_hash.
Judges each attempt's model and lets prepare_model_request persist history changes.
The event stream stays alive when a resumed session loses a tool call without an ID.
OpenAI, Anthropic, and Gemini batch requests ignore max_retries instead of raising UserError.
The canonical system value is preserved through Vercel AI and AG-UI message round-trips.
Accepts list-typed content from compatible servers.
Reports no audio input for OpenAI non-audio models and no video input on Bedrock outside Nova.
Plan tools' results show the harness plan rather than a per-request reminder copy.
Usage and response IDs received by a primed stream are retained even if the consumer leaves without iterating.
Queued realtime messages are delivered after a mid-reply reconnect on OpenAI, Azure, and xAI.
Nested instruction files between a traversed path and the working directory are surfaced without repeating the root file.
Nested instruction files explain how they relate when nested_traversal is enabled, and files above the working directory are labeled as ../AGENTS.md.
Compatible compactions are honored during Responses continuation.
V1-style result.usage() now warns instead of raising TypeError.
Job files use a private temporary directory when the workspace is not writable.
Failure records are kept when an anyio scope cancels a run.
Children sharing usage run under the parent's usage_limits.
Request-scoped system prompt parts are marked visible: false in OTel spans for requests where the model no longer sees them.
No longer leaks script or style source into markdown content.
Teardown no longer causes RuntimeError: coroutine ignored GeneratorExit or an escaping KeyboardInterrupt.
Per-message effort changes are sent through this integration on Claude Opus 5.5, and thinking-block binding recovery is enabled.
The rate-limit category is preserved for Azure too_many_requests Responses failures on openai>=3.32.0.
When a hook rewrites history, the instructions it sent are recorded with a copy of the request.
If repl_store loading fails, the stored REPL state is retained instead of being overwritten with a fresh REPL.
Bare None type arguments are normalized.
A request records a deferred capability's instructions when a before_model_request hook loads it.
Framing tags are escaped consistently in BackgroundTools, RepoContext, TrajectoryJudge, Planning, and the SummarizingCompaction summarizer transcript.
Typed turns on Gemini realtime models now see the image sent immediately before them.
A GPT-Live WebRTC sideband session ends cleanly when the browser hangs up.
A thinking change after an unanswered ModelSettingsDeltaPart is recorded instead of replacing it, preserving it in UI streams and hook-rebuilt requests.
Runs are evaluated with every OnlineEvaluation capability on an agent, not just the outermost one.
A pending batch request is withdrawn if the run does not end with its PendingModelResponse.
Realtime span model_settings is omitted when include_content=False.
A wrap_run or on_run_error recovery result is returned rather than raising AgentRunError.
The model's realtime SpeechPart.id now records the provider item ID.
In delta mode, a transcript corrected to empty now clears its caption.
An automatically generated summary that would make history larger is no longer committed.
On models without mid-conversation system messages, the tag's meaning is stated and the tag is escaped in user and tool text.
Spill writes run in a durable_operation so replay does not write them again.
Streamed assistant messages are split at reasoning, compaction, and preserved file parts, as AGUIAdapter.dump_messages does.
No longer injects newlines between adjacent TextParts.
Counts a ModelRetry raised after a tool's step has ended toward max_retries.
Forwards nested ToolReturn.content from run_code to the model instead of silently dropping it.
History before a CompactionPart with an empty summary is retained instead of treating it as a compaction boundary.
The model is now recognized by DeepSeekProvider.
Recognizes the deepseek-flash model.
An explicit FileUrl media_type takes precedence over the downloaded Content-Type; binary/octet-stream is treated as unknown.
Replays local history into a fresh Gemini Live session when a reconnect has no resumption handle.
Works on the default Gemini provider with a separate v1alpha Live client.
Preserves Cohere response IDs in ModelResponse.provider_response_id.
Carries non-native Claude thinking in a user turn on OpenAI-compatible providers.
The reconnect policy re-attaches a dropped GPT-Live WebRTC sideband.
Preserves Gateway costs in Groq streams.
Anthropic no longer replays a non-empty result as "No matching tools found" when its matches are no longer declared.
Fixes thinking=False on OpenRouter's anthropic/claude-sonnet-5.5, which cannot turn reasoning off.
Realtime models are told about tool-call failures on every provider so they answer instead of going silent.
Limits no longer reduce load_capability and search_tools returns; combined bands remain largest-first, with the later band winning a shared threshold.
Each UIMessage of a split request gets its own id in Vercel AI dump_messages().
Supports
hang_up()for Azure OpenAI WebRTC calls.Raises
UserErrorinstead ofAssertionErrorfor an unconverted responseSpeechPart.Retries when redacted schema keys collide.
Failed re-authoring keeps the last valid capability, locks are shared per directory, and runs can cancel authoring.
Runs authoring checks and no longer overwrites unreadable manifests.
Discoveries no longer rewrite the cached prompt when
dynamic_catalog=True.Stops returning inherited history once per run and clips excerpts around the matched term.
Keeps deferred tool entries in place when a deferred-loading capability is loaded on Anthropic.
Validates
envandsandbox_timeoutat construction and names the operation in probe timeouts.Cancels Exa runs left behind by a cancelled poll and stops retrying errors the model cannot fix.
Rebuilds its default client on a new event loop and builds the client once.
Supports
NativeOutputon every FireworksProvider model.No longer sends a thinking configuration that this model rejects.
Leaves audio split from its words by a tool call out of history instead of recording an empty
SpeechPart.Attaches a late sideband that is no longer sent
session.started.Includes tool-call
argumentsin message history.Keeps
Linear(id=None)uncombined, matchingGitHub(id=None).Boolean and integer inputs now stay on separate
Literaldecision branches inpydantic_graph.The first-run banner now points to the wizard with the
pydantic-aitask.Preserves dictionary key order when histories are stored and reloaded, keeping resumed-run prompt caches.
Keeps responses with non-standard
finish_reasonvalues instead of raisingUnexpectedModelBehavior.Can force a tool revealed mid-run on models before GPT-5.6.
Preserves streamed reasoning that arrives without
reasoning_details.Concurrent workspace runs remain attached to their own Prefect environments.
Carries sub-agent cancellation across the durable tool-call boundary as a failed tool result.
Omits framework-owned
__pydantic_ai__metadata from sanitized output, matching UI adapters.Starts long quote-heavy shell commands and returns commands too long to start to the model.
Uses
TOOL_CALL_ID_PREFIXrather than a hardcoded prefix to detect pydantic-ai-minted Gemini tool-call IDs.Preserves citations in the Vercel AI adapter.
Records failed status on streamed native tool return parts.
Stores a failed non-streamed native tool call as a call part and one return part.
Uses explicit output_type overloads, alongside Agent.from_file.
Supports anthropic 2.x by building message parameters as dicts and retaining Bedrock's anthropic_version.
Emitted with failed=True when the AskUser answerer raises.
Fixes cancelled steps, tool metadata key validation, and handler typing.
Response handlers are now applied when continuing a suspended response.
OpenAI GPT-Live now accepts an explicit input_transcription_model='auto'.
Treats id=None as the default ID and accepts client with auth=''.
Invalid templates now reject TemplateVariable and fall back to the code default.
wait_retry_after now honors the retry-after-ms value.
The background setting now takes effect on BackgroundTools.
Accepts unrounded float probabilities and scores from backends such as vLLM.
Allows strategy='bm25' on the legacy Bedrock AsyncAnthropicBedrock client.
Applies an ElevenLabs Agents correction only to the message it names.
Keeps typed const constraints, such as Literal discriminators, in Anthropic strict schemas.
Treats auth='' as unset alongside client in DayAI.
Retries deeply nested optional-tool arguments instead of raising RecursionError.
Schedules a tool once when BackgroundTools instances with distinct ids select it.
Moves unsupported Bedrock array contains constraints into descriptions.
Can clear typed read_file results again.
Preserves boolean $defs semantics during schema transformation.
Fixed revealed type names, nested tool exposure, and empty WorkflowAgent descriptions.
Added to xAI known models and the Grok reasoning profile.
OpenAI-compatible chat completions now accept non-string metadata values.
Keeps a push-to-talk turn in realtime history when the session ends before the provider confirms commit_audio().
Records a realtime barge-in cut in history when interrupt() races a failed send, reply end, or later cancel.
Recognizes Bedrock inference profile and foundation model ARNs so they receive the same model capabilities as the bare ID.
CodeMode checks the tool-call limit before each nested tool call.
Added a realtime lifecycle event so an abandoned tool call no longer holds its exchange open.
Streams returns of tool calls skipped after a final result to AG-UI frontends.
Preserves separate UserPromptParts through a round trip.
Ignores deeply nested ReasoningMessage.encrypted_value JSON.
Fixes UseEnumMemberDocstrings enums, Choices, and BoolCriteria failing in strict schemas.
Uses automatic prompt caching through anthropic_cache.
Fixes tool_choice='none' failing after a tool call.
Clears tool results in batches instead of on every request past the threshold.
Resolves the default output mode once per run so toggling thinking per step keeps tools stable.
Falls back on stream errors raised before the first event.
Writes mapping keys that are not valid XML names to a key attribute.
No longer return DeferredToolRequests to a parent that cannot resolve them.
Closes the AsyncInferenceClient it builds when the provider or agent exits.
Rewrites nested $refs when merging JSON schema definitions.
Walks propertyNames and contains when inlining JSON Schema definitions.
Forces a single tool natively instead of filtering tools.
Sends tool results in call order so UI round trips keep the prompt cache.
Adds a tool-call ID length profile setting and rewrites IDs rejected by Mistral models.
Keeps an unsaved token refresh instead of reverting to stored credentials it spent.
Stops continuing an OpenAI response once its preceding history or the response itself has changed.
Ends a response created without an id when a malformed response.done closes it.
Processes streamed responses as well.
A realtime reply cut off by the user is recorded as interrupted after generation finishes, and seeded interrupted speech is marked.
Replacing the client's system prompt no longer removes mid-run system prompts.
Escapes context-file blocks and sends the nested-directory pointer as a SystemPromptPart.
Labels a symlinked instruction file with its target's name, so CLAUDE.md -> AGENTS.md reads AGENTS.md.
Keeps every usage counter so durable runs retain one-hour cache writes and reasoning tokens; declares cache_write_1h_tokens and output_reasoning_tokens.
Non-native ThinkingParts are carried in a user turn for models that imitate assistant formatting.
Sends tool-call arguments as compact JSON so UI round trips keep the prompt cache.
Preserves tools reveals when a Vercel AI frontend rebuilds history from the event stream.
A resumed 'suspended' response's usage is counted only in the run that produced it.
Streams returns of tool calls skipped after a final result to Vercel AI frontends.
Keeps parallel tool calls in one ModelResponse when loading messages.
Preserves separate UserPromptParts through a round trip.
No longer waits forever when a realtime tool batch receives no reply after a call is cancelled.
Waits between continuation polls are durable DBOS.sleep steps under DBOSDurability and DBOSAgent.
Warns when response handlers are skipped on a streamed request.
GoogleModel now supports Gemini agentic media processing.
A backend response that ends while the session closes is now counted as a request.
Closes the HTTP client for a model built from a model name and reuses one client per name inside async with agent.
Gemini tool-call thought signatures are now sent back from OpenAIChatModel.
In default 'auto' mode, current-turn tool calls now receive an empty thinking field when needed.
Unavailable tool_choice names are no longer sent in allowed_tools.
Planning tool loops remain in the prompt cache, and a leading CachePoint is attached to the previous user message.
Cleanup is awaited after early exit and cancellation.
Realtime output now records and streams one part per output item even when its transcript arrives late.
Run context copies inside Temporal activities and Render child tasks retain available_tool_names and active_capability_ids.
Skills now honor disable-model-invocation and user-invocable, and skip stray skill library paths.
The partial response of an interrupted stream is now charged.
Concurrency slots are released after streamed request cleanup.
Token-based compaction now retains more recent history.
A tool's prepare function now has its own retry count under .prefixed(), .renamed(), and PrefixTools.
The discriminator mapping now references multimodal URL choices.
Unset optional fields are omitted from UIMessage JSON so the AI SDK accepts it.
User prompts quoting its [WarnNearLimits] marker are no longer deleted.
Sessions can reconnect past max_duration when a reconnect policy is set.
AnthropicModel no longer picks native structured output that Bedrock rejects on AsyncAnthropicBedrock.
The opt-in needed when Claude Fable 5 / 5.1 reject the default mode is explained.
Gathered CodeMode calls run concurrently under parallel_ordered_events.
Stale thinking blocks are retried with drop_block when Bedrock rejects them.
Decorated partials are unwrapped when evaluation task names are inferred.
Native tool events are recorded in gh-aw sessions.
Changed instructions and tool-returned files are no longer double-counted in harness context estimates.
The Memory snapshot is kept with the latest user prompt instead of after tool results.
Adjustable reasoning is supported on mistral-large-4 and mistral-large-4-0.
Explicit prompt caching fields are no longer sent to the openai-codex backend.
openai-decisions pricing is checked before matching the shared OpenAI base URL.
Importing pydantic_ai.models works on Pyodide by skipping the eager httpcore2 import on Emscripten.
Python 3.15 is supported.
A chunk whose send fails is no longer recorded in realtime SpeechPart.audio while it is being sent.
Repeated runs keep one summary, receipt, and system prompt copy.
List-form tool_choice can name output tools, and static lists may include one.
Every UsageLimits field is mapped to an explicit ACP stop reason.
xAI server-side tool results are replayed as tool turns paired with their calls.
ID-only tool call deltas no longer emit a
nullargs fragment.Returns 422 instead of 500 for invalid chat requests.
Its public shape is included in its validation JSON schema.
Earlier breakpoints are raised to a later, longer TTL so requests are not rejected.
Retried requests no longer send empty base64 image and PDF bytes.
Decodes percent-encoded Base64 payloads.
OpenAI's implicit prompt cache is kept when
cache={'messages': False}cannot place an instruction breakpoint.A leading cache point is attached to the previous OpenAI message instead of raising.
Interrupted tool calls are closed out when resuming a sub-agent.
A capability operation runs inline when called from inside a durable unit.
No longer ignores handler functions in
fallback_ontuples.Budgets are charged for responses rejected by a fallback model.
Serializes as
nullfor extensionless URLs instead of raising.Transport errors that escaped these providers are now raised as
ModelAPIError.Malformed events are reported as recoverable errors instead of being dropped.
Cancels the streamed model request when a parallel input guardrail blocks.
Ignores media-type parameters.
Handles JSON-pointer
$refs and draft-07definitions.Hides MCP Apps tools from the model when
_meta.ui.visibilityomits"model".Dynamic system-prompt re-evaluation no longer mutates caller-owned message history.
No longer lengthens connect and pool timeouts of Pydantic AI-created HTTP clients.
No longer widens the cache-health window on GPT-5.6+.
Keeps streamed arguments when the
donesnapshot disagrees instead of starting the part again.Keeps completed tool returns when a sibling raises or the run is cancelled.
The default remains stable when a durable run is re-executed.
Run state remains recoverable when Ctrl-C interrupts streaming mid-output.
Ending GPT-Live sessions with
session.closerecords final usage.Keeps the current request when a receipt would take the only kept slot.
Keeps the live workspace on a settled result.
Rejects whitespace-only summaries instead of replacing history with an empty summary.
Preserves the current request when retained user turns exhaust the tail budget.
Sends a generic question when a question would otherwise have no instructions.
Its JSON schema now infers the wrapped function's return annotation.
Reconnects by replaying local history because xAI conversation resumption drops typed user turns and tool calls.
Commits a turn up to its usage limit instead of rolling it back.
Finds the tool search tool by tool_kind so prefixed search tools still receive their notes.
Propagates a native cancel that arrives during the timeout's stop operation.
Streamed and complete responses build the same ModelResponse; Gemini 3 web search sources are also added.
Works under FallbackModel and with dataclasses.replace.
Falls back to the local tool on Gemini text models and preserves tool output when a native tool falls back locally on Gemini 2.5.
Handles draft-7 list-form items in JSON schemas.
Generation failures are logged instead of silently falling back to GoalReanchor text.
Loads a capability only once when called twice for it in one response.
Adds replay_safe to support replay-safe custom setup_logfire callbacks.
Handles draft-7 list-form items in streamed output.
Undecodable 200 response bodies from the listed providers' models now raise ModelAPIError.
Clamps truncation at the profile's audio_output_sample_rate.
Preserves text and reasoning part boundaries in streams.
Warns when read_only=True removes every hosted MCP tool.
The shell fallback fails closed when readlink cannot read a symlink.
Usage now includes function tools run after the final result.
Run state remains recoverable when Ctrl-C interrupts execution.
Recovers run state when a DBOS workflow is cancelled.
Identifies the tool by its tool_kind instead of its name.
Treats a null finish_reason like an empty one.
Accepts boolean subschemas, caps prefixItems at maxItems, and handles draft-7 list-form items.
A first-position announcement is kept out of the standing system prompt.
Pins the request that started the current run, rather than the conversation's first prompt, in the window.
The derived Temporal schema now allows unschemable types.
Avoids invalid-escape warning floods during analysis.
Calling commit_audio() alone no longer triggers an xAI push-to-talk reply.
An xAI push-to-talk create_response() call is always answered.
Restores reveal announcements after compaction or history loss.
Non-finite metrics are rendered as inf, -inf, or nan.
Thinking efforts are snapped to minimal and high on the Gemini API.
Can declare tools whose dict values are recursive models.
A timeout during process startup now kills the process group.
Makes spans replay-safe.
Keeps the registered toolset across runs so durable execution accepts it.
Tolerates status, status_details, and session values that the SDK does not yet know.
Streamed and complete responses now build the same ModelResponse.
Streaming now builds the same ModelResponse as a complete response.
When openai_store=False, image generation calls are left out of replay.
Keeps the registered toolset across runs so durable execution accepts it.
No longer forces thinking on disk agents.
Raises UnexpectedModelBehavior instead of running the wrong tool when function tool calls share an ID.
Streaming now builds one thinking part per output, matching the non-streamed response.
Treats this MIME type as text-like for inline model inputs.
Allows
azure_voice_live=Trueforgpt-realtime-2models.Keeps the prompt as the judged text after a retry.
Emits this event in realtime sessions before the deferred tool-call handler runs.
Allows text output on Vertex.
Records the value as the realtime response's
finish_reason.Maps provider errors from token counting.
Bounds the Gemini Live handshake.
Maps every Mistral SDK error to
ModelHTTPErrororModelAPIError.Tool-forcing and thinking-default profile flags now live on
ModelProfileand apply on every provider route.Raises
ModelAPIErrorwhen the API reports a failed response or anerrorstream event.Maps in-stream error objects to
ModelAPIError.Truncates the provider's copy of a reply the user cut off after it finished generating.
Records realtime user turns in speaking order under push-to-talk, barge-in, and with input transcription off.
Roots union output member
datavalidation errors underresult.dataso retry feedback retains the failing input.Reads a job log deleted mid-read as empty instead of failing the call.
Counts separately budgeted SubAgent usage toward parent budgets.
Keeps the original request in its window when the transcript is clamped.
No longer hangs on merged or failed replies; parallel realtime tool results request one answer per batch.
Maps provider errors from file uploads.
Buffer text deltas during replay.
Match dated Gemini 3.8 Live ids.
Keep
provider_detailson OpenAI Realtime tool-call responses.Updates together with the usage it reports.
Preserve the response id on replies cut off by a drop or
close().Resend a recent image with a typed Gemini Live turn, which doesn't see video frames.
Prices one-hour cache writes at the one-hour rate instead of the five-minute rate.
Keeps user speech out of history when input transcription is off.
Stops Google Search from crashing Gemini 2.5 native-audio realtime sessions.
Takes Jev's context_window from genai-prices.
Preserves the type variable of a generic OutputSpec[T] passed to Agent.run under mypy.
Prices realtime image input at the image rate.
Keeps user turns whole when the microphone streams continuously on providers without input item IDs.
Surfaces a failed OpenAI realtime response's error as a RealtimeSessionErrorEvent.
Buffers five minutes of audio per view so speaker-paced playback gets whole replies.
On OpenAI Realtime, thinking=False turns reasoning off by sending reasoning.effort: 'none'.
ThinkingParts are now sent in the history that decision models judge.
A send refused by the provider is rolled back so wait_for_reply() no longer hangs.
Keeps an uninstrumented delegate's usage off its caller's agent run span.
Preserves output tool names and descriptions for Annotated model types.
Allows gpt-6-sol, gpt-6-luna, and gpt-6-astra models.
Drops temperature and top_p for OpenAI GPT-5.6 and GPT-6 instead of failing with a 400.
Fixes google_proactive_audio so Gemini Live sessions can connect.
Forwards Cloud Storage gs:// references as fileData on Vertex AI.
Preserves fanned producer contributions in graph joins.
Surfaces streamed node errors in context during graph.iter().
Makes RunContext.tracer, trace_include_content, and instrumentation_version follow an explicit Instrumentation capability.
Sends deferred tools with native tool search instead of failing with a 400.
Types None in a list of output types as | None so output_type=[Foo, Bar, None] passes pyright.
Keeps Annotated metadata on members of an X | Y output_type.
Accepts Annotated, Literal, and union output_type values as PEP 747 TypeForms.
Preserves all streamed OpenAIChatModel logprobs in provider_details['logprobs'].
Surfaces receive-side failures to every consumer shape and ends send_audio(iterable) cleanly on close.
Applies a field's default when TypeSafeModel answers “None of these” for an optional field.
Applies a nested model's default when TypeSafeModel answers “None of these” for every field under it.
Preserves AG-UI
Message.idacrossAGUIAdapter.load_messagesanddump_messages.Preserves
UIMessage.idacross Vercel AIload_messagesanddump_messages.A Choices set can describe itself as a TypeSafeModel route.
A None output route is named None rather than NoneType.
Refuses rubrics with more levels than Jev scores against.
Refuses a tuple output field and a self-contained model instead of crashing.
Can pick None as a route.
Recognizes None routes and None options that carry a description.
Names the picked route in the request that fills it.
Allows adaptive thinking with tool output and forced tool choice.
Dispatches tool calls with the live ToolDefinition.
Gateway IDs are no longer misclassified as OpenAI o-series models.
Late transcripts remain attached to the user turn they belong to.
A realtime tool exception records a failed ToolReturnPart, while a tool call and its speech stay in one ModelResponse.
Refuses more options than Jev can pick from.
Realtime responses are priced so usage.cost and UsageLimits.cost_limit work in a session.
Raises ModelRetry when httpx2 rejects a URL as invalid.
Resolves a DynamicToolset once per durable run instead of inside every durable unit.
Passes xhigh effort through on Bedrock when the model profile supports it.
Allows this model on Bedrock Converse.
Uses one MCP server session per durable run instead of one per durable unit.
Preserves tool history in MCPSamplingModel.
Stops importing legacy httpx, which a FastMCP 4 install does not ship.
Reports each agent run's own usage on its span.
Allows construction without a model and defers the model requirement until runtime.
Forwards blocked domains to OpenAI web search.
Runs a capability's prepare_tools over every tool admitted by the availability gate.
Bounds the event queue while nothing is iterating it.
Finishes teardown even when the closing task is cancelled.
Makes enqueueing safe when called from worker threads.
Fixes OpenAI-hosted tool_search pairing in AG-UI.
Preserves text part boundaries after tool calls.
Keys temporal tool opt-out checks on operation kind rather than an MCP import.
Anthropic recovery is preserved across normalized history.
Honors
anthropic_disallows_sampling_settingsinBedrockConverseModel.Non-object
$refdefinitions in code-mode function signatures are now resolved inline.Botocore transport errors are now wrapped in ModelAPIError.
Anthropic native web searches are now priced in cost.
Gemini thinking levels are snapped to the nearest supported level.
Anthropic native web searches are now reported in RequestUsage.details.
Allows a capability to cache derived state again and refuses a collection the merge cannot rebuild.
Makes a capability's auto-assigned registry key look like the run-local handle it is.
Lets a realtime tool hang up with
ctx.realtime_session.close()instead of wedging itself.Fixes reveal synthesis splitting a parallel batch's
tool_resultfrom itstool_use.Maps
finish_reasonon OpenAI Responses stream terminal events.Fixes the
interrupt(played_ms=)cancel race.Ends the views when a tool fails and nobody is iterating.
Rolls back user-turn state when an audio chunk is not bytes-like.
Stops sending
reasoningto the datedgpt-realtime-2025-08-28snapshot.Subscribes the view when
stream_audio()is called, not on first iteration.Subscribes the view when
stream_transcripts()is called, not on first iteration.Detects Azure content-filter errors for AsyncAzureOpenAI clients on OpenAIProvider.
Detects Azure content-filter errors for AzureProvider.
Restores capability composition invariants.
Fixes the context_subtree() exporter cache and its span-processor leaks.
Restores the Instrumentation spec option for including model request parameters.
Emits speech finalized by a tool call on stream_transcripts().
Attributes tool-returned media to its originating tool call when it cannot ride the tool result.
Sharpens the undeclared-attribute merge error.
Stale thinking-block recovery now persists across turns.
Restores raw tool-call IDs when replaying Responses history.
Fixes uploads failing to reach a fresh Anthropic container on multi-turn history.
Accepts the environment-key call pattern in the provider overload.
A run cancelled during its first tool call remains resumable.
Fixes forced
tool_choicehandling for DeepSeek and Together.Fixes streamed text after a native tool call being merged into the ended pre-call part.
Preserves dynamic
nativefactory config in fallback subagents.Skips inactive capability hooks in agent tracebacks.
Accepts and maps Z.AI's non-standard finish_reason values.
Routes Vertex-versus-Gemini API branches by client transport instead of provider name.
Journals Prefect tool discovery in tasks.
Emits an AG-UI TEXT_MESSAGE_START for the assistant message that owns a response's tool calls.
Bare ToolDefinition instances are now projected into Prefect cache keys.
Fixes generation for narrow exclusive numeric bounds.
remaining now resolves result IDs across categories.
Errors now identify rejected runtime toolsets.
Heroku GLM models are now routed through zai_model_profile.
dbos is capped below 2.31.0 to avoid a missing opentelemetry-instrumentation-logging import.
Bedrock guardrail trace is now carried in ModelResponse.provider_details.
Temporal responses now honor provider_factory when they are cancelled.
Makes the inclusive integer maximum reachable in TestModel.
Preserves an explicitly empty Tool description instead of falling back to the function docstring.
Only strips
logit_biasfrom Cerebras model settings.Preserves zero-argument tool calls.
Recognizes Bedrock’s
r1alias.Renders enum
$refsasLiteral.Honors the agent tool retry budget.
Honors zero-valued maximums.
Fixes generation for equal inclusive bounds.
Fixes generation for falsy JSON Schema
constvalues.Fixes stale part state when a stream is cancelled.
Accepts reasoning part
idin run input.Preserves the Groq profile for
groq/-prefixed models.Handles asctime-form
Retry-Afterdates.Normalizes DeepSeek Responses function-call replay.
Async callable instances are now awaited in pydantic_evals tasks and by the evaluate decorator.
Fixes RunContext.cancel() in realtime sessions.
VideoUrl now recognizes m.youtube.com URLs.
The
functionparameter accepts any callable.The
stream_functionparameter accepts any callable.Empty-signature Anthropic
thinkingblocks are no longer sent.Native tool calls are dropped when the replayed payload has no result block for them.
Cancellation from setup-phase for_run hooks is recorded instead of raising UserError.
Sync hooks run in a thread pool, and timeout= is enforced for blocking sync tools and hooks.
A response containing only empty text parts is treated as having no text output.
Tool results are sorted ahead of tool availability announcements so Bedrock accepts turns revealing multiple tools.
The retry message lists only available tools.
Gemini models that reject MINIMAL now fall back to thinking_level='LOW'.
Failed FallbackModel spans are attributed to the failing model rather than the fallback wrapper.
The openai package is passed through Temporal workflow sandboxes.
Falls back to ASCII output on non-UTF-8 consoles.
Resolves deferred openai resource imports and genai-prices data loading at Model construction time.
Lowercases model names before profile lookup in SambaNova, Heroku, and Fireworks providers.
Anchors the tool-callability evidence window to the response's serving provider.
Fixes concurrent provider stream shutdown.
Fixes inherited realtime WebRTC and Azure bugs involving
for_realtime.Fixes silent truncation of gzip response bodies.
Rendered tool signatures now include parameter descriptions.
AG-UI dict tool-call deltas are serialized with Pydantic Core.
A leading CachePoint is attached to the preceding user message instead of raising an error.
Realtime reconnects now settle in-flight state and report state_restored honestly.
Adaptive thinking is now allowed with Tool Output and forced tool choice on Anthropic.
Offline web UI hosting now points at the self-contained chat UI build.
Tool spans are restored for failed argument validation, making those failures visible in tracing.
Corrects finish_reason mapping for streaming responses.
Anthropic compaction encrypted_content is now round-tripped verbatim.
The include_binary_content=False setting is now honored in every OTel serialization sink.
sanitize_messages now strips the compaction provenance stamp.
Fixes has_attributes matching for JSON-serialized dict and list values.
The standing prompt is no longer re-sent when the OpenAI Responses compaction item retains it.
Errors for oversized tool returns or model responses now point at the cause.
ToolReturn.tools now retains the redacted OTel shape.
Only the compacted window is sent: history before the latest same-provider CompactionPart is dropped.
Deferred tools remain searchable after discovery, and reveal state resets at CompactionPart boundaries.
Fixes a reveal-state edge involving is_tool_available.
Restores the released legacy profile-key shim for compatibility.
WrapperModel now forwards model_id, and TemporalModel resolves it against the active model.
Streamed OpenRouter reasoning details are mapped by their index.
OpenRouter is gated off from native mid-conversation system messages using supports_inline_system_prompts=False.
Fixes a reveal-state edge involving native additions in TestModel.
Forwards events from callbacks that return an async iterator, even when the callback is not an async generator function.
Omits server attributes when the
base_urlport is malformed.Azure sends
max_tokensfor Mistral models instead ofmax_completion_tokens.Fixes
thinking="minimal"for GPT-5.6 models.Degrades malformed tool-call arguments in
ToolCallPart.args_as_json_str().Forwards
base_urlthroughWrapperModel.The Google provider filters unavailable names from
allowed_function_names.Stream part indexes are now preserved during event replay.
Groq
groq/compoundmodel names are now recognized.Bedrock streams now honor
ignore_streamed_leading_whitespace.Content newer than the installed
ag-ui-protocolis skipped instead of causing a 422 response.Heroku's model is now recognized as a Kimi reasoning model.
The model is now recognized as a Kimi reasoning model.
Caller-owned OpenAI model settings are now preserved.
The Google provider now preserves an explicit
timeout=0instead of dropping it.Bedrock now sends
top_p=0.0rather than omitting the value.The function now guards against negative integer
Retry-Aftervalues.Capability event-stream and node hooks now fire under agent.iter().
Async streams are closed on teardown rather than left for the garbage collector.
bedrock_max_concurrency is validated instead of allowing a value of 0 to deadlock.
Binding now preserves capability container subclasses.
The stable Gemini Gateway alias is restored.
The provider created timestamp is read from any chunk in streaming responses.
The Temporal LogfirePlugin now preserves the host's Pydantic AI instrumentation.
The bound on the Temporal payload TypeAdapter cache is removed.
Runs when an args_validator defers the call.
A tool's args_validator can request approval or defer a call.
MCP tools inherit agent retries.
InstrumentedModel passes the unprepared request to the wrapped model.
OpenRouter responses with null choices and no error envelope now raise ModelAPIError.
Avoids forcing tool_choice so thinking remains active.
Fixes tool-call cache keys so flow retries replay tool results and keys account for readable RunContext fields.
Raises UserError instead of hanging when called on an event loop it cannot drive.
Synchronous APIs handle closed event loops rather than failing unexpectedly.
Per-tool TaskConfig is honored on Prefect MCP tools.
Tool, MCP, dynamic-toolset, and event-stream activities now heartbeat.
Avoids retrying forever when a Temporal activity argument cannot be serialized.
Post-validation hooks can raise ApprovalRequired or CallDeferred, while pre-validation hooks can raise UserError.
Refreshes KnownModelName from Gateway probes and stable Google image IDs.
Captures Anthropic thinking tokens in usage details.
A bare McpError from an MCP server is recoverable instead of fatal.
Preserves zero-valued OpenTelemetry usage details.
Exposes the OpenAI Responses phase on the streamed PartStartEvent.
Preserves arbitrary RequestUsage fields across serialization.
Replays tool-search history across provider boundaries instead of dropping it.
Skips include_server_side_tool_invocations for Vertex on Gemini 3+.
Re-asserts absorbed external cancellation at run step boundaries so cancellation is not lost during a run.
Deferred google-genai stream errors are mapped in GoogleModel.
Response-scoped tool-call IDs are normalized.
Fixes ContentFilterError handling for real Model Armor response blocks with finishReason: MODEL_ARMOR.
Preserves failed tool outcomes across AG-UI message round trips.
Raises a consistent error from
ctx.enqueue()inside durable units across Temporal, DBOS, and Prefect.Guards against calling
ctx.enqueue()from anevent_stream_handlerinside DBOS steps or Prefect tasks.Preserves sibling keywords on
$refwhen inlining$defs.Fixes tool retry counts across skipped steps.
Fixes durability capability compatibility regressions.
Fixes OpenAI background retrieve 400 errors involving reasoning.encrypted_content on persisted responses.
Tool control-flow exceptions round-trip on DBOS and Prefect, and Prefect replay edges are fixed.
Fixes hosted tool_search replay when call IDs are null.
Untyped arrays are marked as not strict-compatible for OpenAI.
MCP instructions are now always fetched via a durable step under DBOSDurability.
Deprecations for durable wrapper agents have been temporarily withdrawn.
Fixes streaming settings for MistralModel.
Passes pydantic_monty through in the Temporal workflow sandbox.
Fixes a spurious OTel Failed to detach context error when a streamed run is interrupted mid-segment.
Open text, thinking, and tool-call message parts are closed when a UI stream errors.
Fixes forwarding per-Part media_resolution in vendor_metadata.
Defers streamed output emission when text ends mid-integer-token.
Fixes tool binding for POSITIONAL_OR_KEYWORD parameters when *args are present.
Serialization now uses field aliases so wire output matches return_schema.
Capability-contributed toolset IDs are derived from the capability for durable execution.
Streamed number and integer validation accepts int-valued numbers and rejects bools.
Anthropic transforms the native output schema when native structured output is selected through the profile.
Bedrock sends the transformed schema when native structured output is selected through the profile.
Onboarding suggests
Agent('test')when provider credentials are missing.Filters native tool calls that are not configured.
Handles Anthropic stop_reason=pause_turn.
Fixes resume when an output tool call is settled in the same batch as deferred calls.
Fixes has_values() returning True when usage details are all zero.
Preserves invalid UTF-8 bytes during instrumentation serialization.
message_history is made provider-valid out of the box by repairing tool-call/result pairing.
Prevents RenamedToolset from silently dropping a tool when names collide.
Fixes event-loop affinity in run_stream_sync.
Attaches xAI ToolCallPart to the preceding reasoning message.
Fixes recursion with typed composition members in JsonSchemaTransformer.
Handles integer timeout values when computing Mistral timeout milliseconds.
The beta is enabled automatically when messages contain an UploadedFile.
A deadlock is fixed when a wrapped model request or agent run survives cancellation.
Nested capture_run_messages calls now capture correctly.
The DBOSAgent wrapper path now guards against an id-less MCPToolset.
The early end strategy is now honored for NativeOutput, PromptedOutput, and image output.
Calling repr() on message parts no longer crashes when a field's != operation returns a non-bool.
Agent tool_timeout is validated.
max_queued is validated for ConcurrencyLimit and ConcurrencyLimiter.
JsonSchemaTransformer now recurses into allOf composition.
Empty and thinking-only responses no longer reuse earlier text as the run output.
Tool max_retries parameters are validated.
Tool timeout parameters are validated.
ToolOutput max_retries is validated.
Handles boolean JSON Schema nodes in the function signature walker.
Preserves HTTPX event hooks in the gateway.
Allows override(model=...) on an agent that has no model set.
Capability
for_runis resolved once per run, and resolved native tools are preserved underoverride(native_tools=...).Recovers File Search grounding that was dropped with native tool parts.
Constrains the eval judge output reason to be concise and retry-safe.
Non-positive concurrency values now produce a clear error.
Conflicting native tool IDs within a capability layer are now rejected.
Fixes cache-key drift for
PrefectAgent.Callable thinking delta provider details are now serialized.
Domain filters are now forwarded to Groq
search_settings.AgentSpec files now write relative schema references.
Bedrock tool-result attachment co-location is handled per model.
Empty model responses now prompt a retry instead of being silently resubmitted.
Empty ModelResponse objects are omitted from Mistral and Cohere request payloads.
UI round-trips preserve
FileUrl.force_download.Union NativeOutput descriptions preserve the union description instead of using the last member's docstring.
Thinking-only responses are accepted when
output_typeallows None.The unified thinking setting is mapped to Groq's
reasoning_effortsetting.Unsupported tool-return media is delivered to Bedrock models that isolate
toolResultturns.Corrects supported media kinds in Bedrock tool returns for Meta, Mistral, and Qwen.
Duplicate deferred tool call IDs are now rejected.
DBOS and Prefect durable runs now preserve runtime event stream handlers.
First-class token counts are excluded from these OTel attributes to prevent double-counting.
Adds MoonshotAI Kimi models to the known model names.
Bedrock now synthesizes a leading user message only for models that require one.
Sync streaming wrappers now run on an anyio portal thread; async
stream_textearly-break teardown is fixed.Fixes MoonshotAI Kimi support for
thinking.DBOS and Prefect durable runs now preserve runtime toolsets.
Preserves extended usage fields from Mistral API responses.
Evaluation rejects non-positive max_concurrency values.
Starts its background task lazily, on the first event iteration.
Synchronous run_until_complete wrappers clean up pending tasks and streams on KeyboardInterrupt.
Forwards WebSearchTool.user_location to xAI web search.
Updates handling of the XSearchTool limit.
ToolReturnPart is no longer reordered after UserPromptPart when dumping messages.
Tool results remain non-empty when the result is an empty list.
The setting is no longer sent without tool_search on models that lack native tool search.
Temporal now resolves dynamic toolset instructions in an activity.
AG-UI and Vercel AI adapter round-trips now preserve vendor_metadata.
File content is no longer silently dropped from tool returns.
Durable-exec MCP get_tools caching is now replay-deterministic.
The message boundary is tracked by position so a rebuilt resumed request is not leaked.
Thinking-only messages are skipped when constructing chat history.
Non-streaming responses now set provider_name.
Vercel AI and AG-UI message round-trips now preserve tool_kind.
Multimodal content is reconstructed using a ToolReturnContent discriminator.
Fixes handling of absolute schema_path values.
Fixes deps deserialization in non-streaming Temporal model-request activity.
Fixes the map firing the join twice on a non-empty iterable.
Suppresses ClosedResourceError when cancelling a graph run mid-send.
Fixes emitting the first item alone when it is delayed past soft_max_interval.
Avoids duplicating /v1 in the Heroku base_url.
Heroku model names are routed through family profiles so thinking is not dropped.
The GoogleModel check now includes CodeExecutionTool.
Usage accumulation now includes output_audio_tokens and avoids duplicate accumulation.
Groq usage details now surface reasoning_tokens.
Handles CRLF markdown JSON fences.
Handles model names that do not contain a slash.
File vendor_metadata now round-trips through the Vercel AI and AG-UI adapters.
For GroqModel and MistralModel, image detail is now forwarded from vendor_metadata.
Adds support for Bedrock token counting in Anthropic.
Calling cancel() on a finished stream no longer flips its complete state.
Instrumentation message attributes are serialized with to_json instead of json.dumps.
Converts ExceptionGroup-wrapped tool errors to ModelRetry.
Adds a return type annotation to PydanticAIPlugin.__init__.
Prevents stalls during multi-server MCP discovery.
Fixes token-count divergence on ToolSearchTool replay history.
Forwards the top_k model setting to Bedrock additionalModelRequestFields.
Forwards additionalModelRequestFields when counting tokens.
Emits reasoning_effort='none' for Cerebras.
Replays zai-glm reasoning in <think> tags and updates the model used to zai-glm-4.7.
Forwards usage.cached_tokens as cache_read_tokens.
Synthesized tool-call turns now send reasoning_content.
Evaluator outputs that are non-finite are disallowed.
Gemini requests no longer send function_calling_config when there are no function declarations.
Retains dropped usage fields across streaming chunks.
Fixes a crash when MCPToolset uses an http_client with FastMCP's follow_redirects keyword argument.
Forwards penalties in completions.
Forwards tool_choice from ModelSettings to the Cohere v2 chat API.
Routes max_tokens to max_completion_tokens or max_tokens according to an OpenAIModelProfile flag.
Accumulates output_audio_tokens in RunUsage.
Fixes unified thinking handling for Groq qwen3 and Cerebras gpt-oss.
Validates the union kind discriminator in text output.
OpenAI requests map image UploadedFile parts to input_image.
Validates UploadedFile.provider_name in tool returns.
pydantic-ai-slim 1629 changes
Breaking changes 25
Native structured output is disabled for Opus 4.7 on Bedrock.
Bedrock no longer promotes tools with strict=None to strict mode, and omits the strict field when botocore is too old.
Region-less Gateway API keys now raise an error.
Adds GoogleCloudProvider as the separate provider for Google Cloud Vertex AI.
Drops mistralai as a dependency from pydantic-ai.
Hooks always receive dict-shaped validated arguments for tools with a single BaseModel.
Resumed requests are excluded from new_messages even when they have the current run_id.
The xAI provider_fallback value changed to
x-aito match genai-prices.Disallows downloading
FileUrls pointing at the local network by default.OpenRouter now sends DocumentUrls as URLs instead of downloading them and sending their contents as bytes.
OpenTelemetry events were replaced with logs.
Support for OpenAI prompt caching options is temporarily reverted and will return in v1.31.0.
The
tool_choice=requiredsetting is disabled for deepseek-reasoner.An error is raised immediately when a response is empty because of a token limit.
Message history is now required to start with a user message.
Markdown fences are always stripped from structured output.
Raises a clear error when a Google content filter is hit and results in an empty response.
The PAIG base URL changes.
With ag-ui-protocol >= 1.0, binary input parts are converted to image, audio, video, or document content; missing MIME type or payload still raises.
Many more dataclasses are now keyword-only, affecting how they can be instantiated.
event_stream_handler now always runs inside a Temporal activity.
Using Google built-in tools with user or output tools now raises an error.
Raises an error if __aexit__ is called when _running_count is already 0.
ModelResponse.price() was renamed to .cost().
Support for Python 3.9 was dropped.
Security 9
Tool schemas submitted through the AG-UI adapter no longer cause exponential expansion when inlined for models that require schemas without
$defsand$ref.The cloud-metadata blocklist now includes Tencent Cloud's instance metadata address, preventing URL downloads from fetching temporary role credentials.
The local fallback now avoids expanding deeply nested JSON on the event loop before applying the returned-content limit, preventing excessive memory use and delays.
Drops credentials on a redirect whenever the full origin changes, not only when the hostname changes.
Fixes tail handling when sanitization drops a trailing client message, preventing a preceding unresolved tool call from being re-exposed and executed with client-chosen arguments on the AG-UI serving path.
UI adapters handle UploadedFile consistently with FileUrl, addressing a confused-deputy file-read vulnerability when processing untrusted client-submitted message history.
URL validation now handles additional IPv6 transition forms to prevent SSRF cloud-metadata blocklist bypasses for affected allow-local downloads.
URL validation now normalizes IPv6 transition forms, preventing an SSRF cloud-metadata blocklist bypass for applications that allow local downloads from potentially untrusted URLs.
Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL
Deprecations 28
The evaluation_name attribute pattern is deprecated in favor of explicit accessor methods.
The evaluator_version attribute pattern is deprecated in favor of explicit accessor methods.
The gateway/gemini: prefix is deprecated in favor of gateway/google-cloud:.
Positional construction of evals classes is deprecated ahead of the v2 keyword-only flip.
The method-style StreamedResponse.usage() is deprecated.
Deprecates pydantic_ai.ext.aci, including tool_from_aci and ACIToolset.
FastMCPToolset is deprecated in favor of MCPToolset.
The provider ID is renamed to google:; the old name is deprecated.
The vertexai switch is replaced by separate GoogleProvider and GoogleCloudProvider classes; old names are deprecated.
stream_responses() is deprecated in favor of stream_response().
Deprecates the Agent constructor’s event_stream_handler= argument in favor of the ProcessEventStream capability.
Deprecates the Agent constructor’s prepare_output_tools= argument in favor of the PrepareOutputTools capability.
Deprecates the Agent constructor’s prepare_tools= argument in favor of the PrepareTools capability.
Deprecates Agent(history_processors=) in favor of capabilities=[ProcessHistory(...)].
Deprecates Agent.to_ag_ui() in favor of AGUIAdapter.
Deprecates AGUIApp in favor of AGUIAdapter.
Warns on bare openai: because it will switch to use the Responses API in v2.
Deprecates OutlinesModel.
Deprecates OutlinesProvider.
Deprecates the pydantic_ai.ag_ui shim in favor of AGUIAdapter.
The instrument argument is deprecated in favor of the Instrumentation capability.
Built-in tools are renamed native tools and can be registered via capabilities=[NativeTool(...)]; old fields are deprecated.
Function-tool events are deprecated for failing output tool calls.
Deprecates
retries.Warn about dict fields when using Anthropic strict mode.
Using Dataset without a name parameter is deprecated.
Deprecates GrokProvider, which used the OpenAI-compatible API.
The openai_supports_sampling_settings field is deprecated.
New APIs and options 259
Adds CachePoint and prompt caching support for OpenRouter.
Adds support for the Claude Fable 5 model.
Adds support for the Claude Mythos 5 model.
Adds known_model_names() to enumerate KnownModelName members.
Adds api_host to XaiProvider so developers can configure the provider's API host.
Adds timeout to XaiProvider so developers can configure the provider's timeout.
Current xAI model names are supported.
Capabilities can be loaded on demand, including instructions, tools, model settings, and hooks.
Grok 4.3 supports the reasoning_effort setting.
Adds support for Claude Opus 4.8.
Adds list_prompts and get_prompt functionality to McpServer.
OpenRouterModel supports anthropic_eager_input_streaming.
Dynamic-tool message parts can now include providerExecuted and title.
Adds a pending message queue API for enqueuing messages through an agent run.
Adds a pending message queue API for enqueuing messages through the context.
Adds support for MCP background tasks (SEP-1686).
Adds support for the
top_kmodel setting in GoogleModel, AnthropicModel, and CohereModel.Bedrock supports native JSON output and strict tool calls.
The gemini-3.5-flash model is now supported.
Adds OpenAI Responses input token counting through OpenAIResponsesModel.count_tokens.
Adds MCPToolset, which uses fastmcp-slim[client].
Adds run_on_errors to opt into evaluating failed calls.
Adds the singular stream_response() API, which yields ModelResponse rather than a (ModelResponse, is_last) tuple.
Adds the openai-chat: prefix; use it to select the OpenAI Chat API.
Adds the Instrumentation capability; Agent(instrument=...) is deprecated.
Adds local= as an opt-in for provider-adaptive capability fallback; automatic fallback is deprecated.
Gemini 3 supports combining structured output and tools.
Native tool search is supported on Anthropic and OpenAI, and custom search strategies can be used with any provider.
Adds the openai_chat_supports_multiple_system_messages profile flag.
Output tool calls now yield OutputToolCallEvent.
Output tool calls now yield OutputToolResultEvent.
Adds a tool_choice setting.
Adds support for Anthropic task budgets.
Adds a runtime override for output retries.
Add support for the deepseek-v4-flash model.
Add support for the deepseek-v4-pro model.
Support options for gpt-image-2.
Adds typed OTel metadata for code tool call syntax highlighting.
Adds OpenAI Conversations API state support through OpenAIResponsesModelSettings.openai_conversation_id.
Bundled Library Skills provide improved coding-agent support.
Adds builtin_tools to agent.override.
Supports dynamic capabilities by allowing callables in the capabilities list.
Adds conversation_id for cross-run correlation.
Supports the OpenAI Responses phase on assistant messages.
Adds a hook for preparing output tools.
Adds a cross-provider model setting, with Anthropic, Gemini API, and Vertex Priority PayGo support.
Adds Anthropic speed support, including fast mode for Opus 4.6.
Adds UIAdapter.sanitize_messages for sanitizing messages.
Handles the thinking setting for GPT-5.5.
Adds the handle_deferred_tool_calls hook for handling deferred tool calls.
Adds the HandleDeferredToolCalls capability for handling deferred tool calls.
Adds the ProcessEventStream capability.
Adds the ReinjectSystemPrompt capability.
Adds UIAdapter.manage_system_prompt for managing the system prompt.
Adds online evaluation via OpenTelemetry events.
Claude Opus 4.7 is now supported.
An OllamaModel subclass is now available.
A stateful compaction mode is now available for OpenAICompaction.
Supports
Agent(output_type=str | None)for optional output.Adds automatic prompt caching support for Anthropic.
Adds prompt cache TTL support for Bedrock.
Adds a graceful end strategy for parallel tool calls.
Allows metadata to be injected per tool call when using FastMCPToolset.
Adds support for xAI FileSearch.
Adds support for the xAI XSearchTool.
Adds the AnthropicCompaction capability for server-side compaction.
Adds CapabilityOrdering with innermost, outermost, wraps, wrapped_by, and requires ordering options for capabilities.
Adds an ordering parameter to Hooks and supports instance references in wraps and wrapped_by.
Adds the OpenAICompaction capability for server-side compaction.
Adds full support for AG-UI 0.1.13 and 0.1.15, including reasoning, multimodal support, and dump_messages.
Adds apply() to AbstractCapability, CombinedCapability, and WrapperCapability.
Adds cached token span attributes per the OTel spec.
Adds function_signature to ToolDefinition.
Adds return_schema to ToolDefinition.
Adds the SetToolMetadata capability.
Agents can use the new ThreadExecutor capability through Agent.using_thread_executor().
Tools and toolsets can use defer_loading to enable tool search.
VercelAIEventStream supports server_message_id.
A local WebFetch tool is available, and the WebFetch capability uses it when the provider lacks builtin support.
Adds
agentto RunContext, making it available to developers using the run context.Adds support for Flex PayGo with VertexAI.
Adds types and limits for gemini-embedding-2-preview embeddings.
Adds a method for retrieving toolset instructions.
Online evaluation infrastructure is added for pydantic-evals.
Adds TextContent for user prompts, with metadata that is not sent to the model.
Dataset.evaluate now supports CaseLifecycle hooks.
Hooks can raise ModelRetry to control retry flow.
Adds anthropic_eager_input_streaming to AnthropicModelSettings.
Adds the openai:gpt-5.4-mini model.
Adds the openai:gpt-5.4-nano model.
Adds bedrock_inference_profile to BedrockEmbeddingSettings.
Adds bedrock_inference_profile to BedrockModelSettings.
Adds a description parameter to Agent and sets gen_ai.agent.description on the span.
Adds support for GPT-5.4 models.
Enables native structured output support for the Ollama provider.
Supports WebSearchTool with OpenRouterModel through OpenRouter plugins.
Adds Nano Banana 2 using the gemini-3.1-flash-image-preview model.
Qwen 3.5 models support native structured output.
Adds support for the gemini-3.1-flash-lite-preview model.
A new UploadedFile object supports files uploaded to providers.
Supports template=False to disable the schema prompt.
Adds an args_validator parameter to tools for pre-execution validation.
Adds support for Gemini 3.1 Pro Preview models.
Adds logprob support for Gemini.
Adds LinePlot as an analysis type.
Adds tool approval integration for the Vercel AI adapter.
Claude Sonnet 4.6 was added, making it available to developers using the Anthropic integration.
OpenRouterModel supports video_url.
Adds an opt-in flag for aggregated usage attribute names.
Adds a property that returns the model identifier in provider:model format.
The Vercel AI adapter now allows BaseChunks to be injected through ToolReturnPart.metadata.
Adds experiment-wide analyses to pydantic-evals.
Adds extra_headers support for the Google model provider.
Adds the repeat parameter to pydantic-evals for multi-run aggregation.
Adds report-level evaluators to pydantic-evals.
Adds the
anthropic_effortsetting.Adds
adaptiveas ananthropic_thinking.typevalue.Adds
anthropic_betastoAnthropicModelSettings.Adds support for Claude Opus 4.6.
Concurrency limiting is added for Agents and Models, allowing developers to limit their concurrency.
Adds a setting to control data retention.
Adds the number of output validation retries to the agent's run context.
Adds an SDK version parameter to fix compatibility with Vercel AI SDK v5.
Adds the html_source parameter to customize the Chat UI source.
Users running with to_cli() can now supply model_settings.
A setting can include OpenAI raw text annotations in TextPart.provider_details.
Users running with to_cli() can now supply usage_limits.
Adds BedrockEmbeddingModel for Nova, Cohere and Titan endpoints.
OpenAI now supports the continuous_usage_stats model setting.
Sampling parameters are now allowed for GPT-5.1+ when reasoning is off.
OpenAI WebSearchTool now supports allowed_domains to restrict the domains used for web searches.
Adds XaiModel, which uses the xAI SDK.
Adds VoyageAI embeddings support.
Adds support for the Bedrock Nova 2.0 built-in Code Interpreter tool.
Adds an integration for Exa search tools.
Google embedding models are supported.
Adds OTel GenAI semantic convention attributes.
Adds support for the SambaNova provider.
Adds support for metadata in deferred tool results.
Set human-readable summaries for Temporal activities.
Agent and agent run metadata is exposed on result objects and span attributes.
Adds the bedrock_service_tier setting to BedrockModelSettings.
Support for embedding models was added.
Request and response models now include local timestamps, and provider timestamps are included in provider_details.
TextOutput signatures now allow typed RunContext[Deps].
DynamicToolset is now supported in Temporal.
Vertex AI Gemini image models now support output_compression.
Vertex AI Gemini image models now support output_format.
A model profile flag supports APIs with native output that still require JSON schema in instructions.
TemporalAgent can switch models at agent.run time.
Adds types for AI SDK data chunk IDs and tool approvals.
Adds support for AG-UI Multi-modal Messages.
Adds an Alibaba Cloud DashScope provider.
Adds FileSearchTool support for OpenAI and Google.
Adds Gemini 3 flash support.
Gemini image models now support ImageGenerationTool.size.
The OpenAI reasoning summary option now accepts 'auto'.
Adds audio input support for Qwen Omni.
Adds a method to launch a Web Chat UI for any agent.
Adds a Web Chat UI that can be launched for any agent with this command.
AnthropicModel and OpenAIResponsesModel now support FileUrl.force_download.
TemporalAgents can be registered to a Temporal workflow using the __pydantic_ai_agents__ field.
Tool timeout support was added, allowing developers to configure timeouts for tools.
Adds a method for obtaining an agent's output JSON schema.
Allows specifying custom clientInfo when connecting to MCP servers.
Adds support for GPT-5.2.
Allows model to be specified as a string.
Adds prompt caching support for AWS Bedrock.
Adds provider_url to ModelResponse and uses it in cost().
Adds CerebrasModel.
Adds prompt caching options to OpenAI chat model settings.
Gemini image generation now supports specifying an aspect ratio.
Adds native structured output support for claude-haiku-4-5.
Tool and resource caching is supported for MCP servers that support change notifications.
Raw CoT reasoning is supported from LM Studio and other OpenAI Responses-compatible APIs.
Built-in tools can now be configured dynamically via RunContext.
Adds a method to convert Pydantic AI messages to Vercel AI messages.
OpenAI model profiles support a custom reasoning field.
The gateway/...:... pattern is added to Known Model Names.
The Deepseek provider supports JSON object output.
Latest Grok (xAI) models are added.
Adds support for the gemini-3-pro-image-preview model with Nano Banana Pro.
The Responses API supports logprobs output.
Anthropic supports native JSON output.
Pydantic validation context is supported.
Anthropic supports strict tool calls.
Adds the
anthropic_cache_messagesmodel setting.Adds Gemini 3 Pro support to
OpenRouterModel.Allows
user_promptin HITL.Adds support for Anthropic's built-in WebFetchTool.
Anthropic now allows document in cacheable_types.
Adds OpenRouterModel as an OpenAIChatModel subclass with additional feature support.
Adds a convenience method to create BinaryContent from a path.
MCP clients now support Resources.
The MCP server instructions are exposed through the MCPServer.instructions property.
Adds ttl to CachePoint and Anthropic caching model settings.
Adds support for Gemini 3 Pro.
Adds support for Gemini enhanced JSON Schema features.
Extracts Google model usage using genai-prices.
Adds a metadata field to ModelRequest.
Adds a metadata field to ModelResponse.
AnthropicModel adds count_tokens.
Metadata can be passed to CallDeferred and ApprovalRequired exceptions and is included in DeferredToolRequests.
UsageLimits supports count_tokens_before_request.
Adds support for Anthropic prompt caching.
Adds GPT-5.1 to the known model names.
Adds token counting support for
UsageLimits.count_tokens_before_request.Run, run result, and message (request, response) classes now have a unique run_id.
A custom provider factory can now be passed into infer_model.
Adds a method to access all messages in an agent run.
Adds a JSON method to access all messages in an agent run.
Adds a method to access new messages in an agent run.
Adds a JSON method to access new messages in an agent run.
Adds gateway support for
api_type.Adds gateway support for
profile.Adds gateway support for
routing_group.Allows additional instructions to be provided at run time.
Adds partial_output to the RunContext provided to output validators.
Adds a synchronous streaming run method.
Adds support for detecting and handling Microsoft Word files.
Implements the
base_urlproperty.Adds synchronous convenience methods.
Supports AsyncAnthropicVertex as the Anthropic client for AnthropicProvider.
Support was added for the Vercel AI Data Stream Protocol.
Experiment metadata was added.
Adds OutlinesModel to run local models using Transformers, Llama.cpp, MLXLM, SGLang and vLLM via Outlines.
Adds FastMCPToolset for developers to use.
Adds a flag to satisfy the vLLM Responses API.
A new graph API is available in beta.
Adds native MCP support for OpenAI and Anthropic via the MCPServerTool builtin tool.
Adds AWS Bedrock support to Gateway.
Adds an http_client option to GoogleProvider.
Adds OVHcloud AI Endpoints as a provider.
Adds api_key support for Vertex AI.
A Claude Haiku 4.5 model is available.
Tools can return AG-UI events separately from the result sent to the model.
Agent instructions can now be overridden contextually.
Agent names can now be overridden contextually.
Adds a convenience method wrapping
run(event_stream_handler=...).Adds a convenience method to get the latest model response.
Adds support for the Anthropic built-in memory tool.
Adds built-in tool call streaming from OpenAI, Google, and Anthropic.
Adds a
descriptionargument to tool function decorators.Adds support for durable execution with DBOS.
Adds support for durable execution with Prefect.
Adds support for image generation and output with Google and OpenAI.
Adds convenience methods for accessing text, thinking, files, images, tool calls, and built-in tool calls.
Adds support for
previous_response_idfrom the OpenAI Responses API.Adds the Pydantic AI Gateway provider.
Adds MCP metadata and annotations to tool metadata for use in filtering.
Adds an identifier field to FileUrl and its subclasses.
Adds docstring_format to FunctionToolset.
Adds require_parameter_descriptions to FunctionToolset.
Adds schema_generator to FunctionToolset.
Tool calls can now be approved by a human in the loop.
Adds a LiteLLM provider for OpenAI API compatible models.
logfire is included with the pydantic-ai package.
Model request spans now include an operation.cost span attribute.
Adds a tool_calls_limit to limit tool calls.
Performance 2
Loading submitted messages through the Vercel AI and AG-UI adapters no longer takes time that grows with the square of the number of parts.
Computes ToolDefinition.function_signature lazily.
Behavior and default changes 67
The base seed setting is mapped to xAI, allowing developers to use it with xAI.
VercelAIAdapter now round-trips message timestamps through UIMessage.metadata.
Makes the XSearch capability model-agnostic by using a subagent fallback.
The beta API has moved out of beta, and the old API is deprecated.
Populates
for_runRunContext withrun_id,conversation_id, andmetadata.Propagates Agent retries to user-provided toolsets.
Tool-execution spans now set gen_ai.operation.name to execute_tool.
Vercel AI regenerate requests are now allowed without messageId.
Excludes run_id from cache key computation.
Warns when Azure OpenAI completions are incompatible with files.
Reverses capability iteration in get_wrapper_toolset for consistency with wrap_ hooks.
Output validators on the tool output path now see the global retry counter.
Anthropic/Bedrock cache boundaries are automatically inserted at the static/dynamic instruction split.
Agent run spans now include the
gen_ai.operation.nameattribute.ImageGeneration automatically falls back to a subagent with an imagegen model when the main model lacks imagegen capability.
All agent run child spans now include agent name and run ID span attributes.
Run IDs are now time-sortable.
Before and wrap model request hooks can use ModelRequestContext to swap the model.
The MCP capability no longer requires an explicit url= in Python or AgentSpec.
Tool preparation functions can now be synchronous.
Adds response-based fallback support for FallbackModel.
Sends multimodal tool results directly to APIs instead of splitting them into user parts.
The redundant parent span was removed, changing the tracing spans emitted while running tools.
Rehauls the Tavily search tool.
Anthropic requests with high max_tokens now automatically fall back to streaming.
Instrumentation version 4 was added to match OTel GenAI semantic conventions for multimodal input.
The evaluator now supports pydantic.BaseModel.
The gateway base URL is inferred from the token region.
DBOSAgent supports parallel tool calls.
Adds YAML and TOML media type support when creating binary content from a path.
An agent can call a nonexistent tool as often as the Agent retries limit specifies.
System prompt functions can now return None.
AG-UI ActivityMessage is now silently ignored instead of raising an error.
The known Groq model names were updated to add production and preview models and remove deprecated models.
AG-UI events now have timestamps.
For models that don't natively support instructions, agent instructions are inserted after system prompts.
end_strategy now also works for output tools, not just tools.
Supports multi-modal output in LLMJudge.
The anthropic dependency is no longer required when using an Anthropic model with another provider.
OpenRouter uses a custom reasoning field.
An agent run with OpenAIResponsesModel can use instructions only.
Automatically strips cache points over the limit.
Missing state deps with AG-UI now produce a warning instead of a UserError.
Falls back on all model API errors, rather than only HTTP status 400 and above.
Reverts enforcement that message history must start with a user message.
FastMCPToolset now works with Temporal.
load_mcp_servers() supports environment variable expansion in mcp.json.
FallbackModel supports Native output mode and ModelProfile.default_structured_output_mode.
Installing on Intel Macs now skips the outlines dependencies mlx, vllm, and torch.
The validation error retry message was improved, changing the message developers see when validation errors trigger a retry.
Run graph/node span names are preformatted for compatibility with other OTel backends.
Makes AbstractBuiltinTool serializable and compatible with durable execution.
Fixes the default api_flavor value.
Includes evals report averages in span attributes, making them available in span data.
Uses
gateway/<upstream_provider>:as the provider name prefix for Gateway.Uses Pydantic AI's cached httpx client by default.
Raises IncompleteToolCall when generation of a tool call reaches the token limit.
Includes all usage fields in OpenTelemetry attributes.
OpenAI usage is extracted using genai-prices.
OpenAI support now includes text, JSON, XML, and YAML
DocumentUrlandBinaryContent.Explicitly requests image response modality from the Google API when the model supports it.
Agent.__aenter__ now returns Self.
Protocol-version-newer message roles, input content types, or media source types that installed models cannot dispatch are skipped with a warning; other invalid request bodies still raise.
The default version for InstrumentationSettings is now 2.
The MCP sampling model now uses default instrumentation.
url no longer needs to be passed as a keyword argument.
NativeOutput is now supported with Groq.
Fixes and other changes 239
Guards against message=None Bedrock start events in the streaming path.
Fixes count_tokens when using native tools.
Fixes incomplete streamed responses when event_stream_handler does not consume the stream.
Fixes a crash when from_data_uri receives a valid non-base64 data URI.
Fixes constructing gateway models inside Temporal workflows by passing provider SDKs through the sandbox.
When google_cached_content is set, the request omits system_instruction, tools, and tool_config.
Forwards thinking=False on hybrid OpenRouter, xAI, and Bedrock routes, aligning silent-drop behavior with direct routes.
Preserves the cache for single-tool Bedrock tool_choice.
Bedrock now recognizes type='adaptive' when checking whether thinking is enabled.
UIAdapter.sanitize_messages strips the force_download flag from client-submitted FileUrl parts.
Bedrock now maps malformed_model_output to FinishReason.error.
Bedrock now maps malformed_tool_use to FinishReason.error.
A warning is emitted when toolset prepare callbacks return None.
Instrumentation no longer emits a false-positive variable_instructions span attribute.
Domain matching normalizes trailing dots and case.
Fixes thinking being silently dropped for Claude Sonnet 4.6 and Opus 4.6 on Bedrock, and adds support for adaptive thinking efforts.
Fixes code execution tool results being dropped when continuing a conversation.
Preserves single BaseModel tool arguments sent in wrapped form when the model uses the default
extra='ignore'.Preserves Xai tool result IDs.
Signatures on incomplete incoming thinking parts are ignored when using Vercel AI.
OpenAI strict schemas with regex lookarounds are avoided.
The MCP integration no longer requires fastmcp.server at runtime.
ModelResponse.state is set to incomplete while the response is still streaming.
The OpenAI image generation tool now omits input_fidelity when its value is None.
OpenAIResponsesModel now respects openai_system_prompt_role.
The setter is no longer deprecated.
Imports are now eager, unbreaking agent runs in Temporal workflows.
Restores the ability to swap the Bedrock client at runtime.
Bedrock model IDs are normalized for capability profile lookup.
The Vercel AI integration emits tool-input-available and tool-input-error for FunctionToolCallEvent.
Spawned tasks are drained during agent cancellation.
Guarantees that
CaseLifecycle.teardown()runs.Runs the MCP session in a dedicated task to fix
attempted exit cancel scope in different task.Cleans up streaming responses when cancellation occurs.
Fix history replay when tool arguments are empty.
Empty ModelResponse objects are skipped when mapping OpenAI Chat assistant messages.
Preserve Unicode in YAML datasets.
Defers anyio.Lock creation via cached_property so the lock binds to the running loop.
Restores wrap_validation_errors on ToolManager function-tool methods.
Uses a non-daemon thread for background evaluators.
Restores per-block cache_control behavior for anthropic_cache_messages.
Propagates the original error when a CallToolsNode stream fails.
Scopes prepare_tools to function tools rather than output tools.
Guard against choices being None in streamed OpenAI chunks.
Send container_id as a string on reuse and unwrap the broken {id: x} shape.
Prevent MCPServer.__aexit__ from being called more times than __aenter__.
Avoid stale client references in model and embedding classes.
Preserve validation error input when retrying tool calls.
Handles dict reasoning_content from Gemini 2.5 models.
dump_messages() now auto-detects deferred tool approval state for vercel-ai.
Validation error input is excluded from retry messages.
Tool hooks are skipped for internal output tools.
Keyword matching for deferred tool search is fixed.
Ollama capability flags are corrected to fix structured output on Ollama Cloud.
Parsing openai_logprobs for streamed responses is fixed.
OpenAI Responses retries are chained through concrete openai_previous_response_id seeds.
Null text in Responses API output is now handled.
Fixes an orphan-task leak in CombinedCapability.
Fixes an orphan-task leak in CombinedToolset.
Fixes the OpenAI compaction chain when openai_previous_response_id is set to 'auto'.
Fixes usage totals for Anthropic compaction.
Skips the api-version query parameter for Azure AI Foundry serverless endpoints.
Handles boolean JSON Schema nodes.
Closes pending tool calls when a stream errors.
Unknown tool calls no longer exhaust the global retry counter.
Makes mcp optional when importing the DBOS module.
Fixes hook recovery for on_node_run_error and after_node_run.
Forces streaming in run() when a capability or hook overrides wrap_run_event_stream.
Fixes renamed schema defs by updating internal $refs, handling missing keywords, and detecting semantically different defs.
Output validators now run for image outputs.
Streaming SDK errors are wrapped in ModelHTTPError or ModelAPIError.
Vercel AI adapter user message processing now handles DataUIPart.
Instruction insertion counts only leading system messages.
Handles null top-level fields when the response is nested in the provider field.
Invalid output tool calls now have consistent error handling between run_sync and run_stream.
Bedrock clients no longer have TTL stripped from cache control.
These outcomes no longer mark tool spans as errors.
Fixes batch embeddings generation with this model.
Fixes service_tier validation failures for OpenAI-compatible providers.
ToolOutput now respects the max_retries parameter.
Capability schema generation now includes full parameter types.
Inserts an empty user message for Bedrock when only instructions are present.
Adds missing effort values to OpenRouterReasoning.
Fixes type inference for the Thinking capability.
Preserves ToolReturn metadata through Temporal serialization.
Handles malformed tool call arguments in the Anthropic retry path.
Sanitizes tool names before sending them to the Bedrock API.
Always passes embedding_types to Cohere embed() to prevent an SDK TypeError.
Adds 512 as a supported Google image generation size.
Fixes model profile matching for Anthropic models with dotted model numbers.
Recovers prior text for thinking-only responses instead of retrying.
Copies the details dict to prevent mutation of the original when adding Usage values.
Follow-up messages no longer fail after built-in tool use.
Thinking detection was fixed for this OpenAI model.
Adds missing tool approval part types for Vercel AI SDK v6.
Fixes YAML export/import round-tripping for SpanQuery arguments.
Fixes builtin tool availability checking when TemporalAgent uses multiple models.
Exception classes gain __reduce__ support so they can be pickled.
has_content() no longer incorrectly returns False when tool arguments contain falsy values.
Vercel dump_messages output now aligns with the Vercel spec.
Google streaming errors are wrapped as ModelHTTPError or ModelAPIError.
Sibling tasks are canceled when any exception occurs during parallel tool execution.
UI adapter runs now include the missing run_id on ModelRequest.
Sets BuiltinToolCallPart.id for OpenAI Responses WebSearch and FileSearch.
Temporal and DBOS MCP now use cached tools instead of fetching them each time.
Updates Cohere content item typing to fix an incompatibility.
Fixes Anthropic models on Bedrock being incorrectly treated as supporting JSON schema output.
Optional fields in OpenRouter streaming models now have defaults.
New messages are identified by run_id instead of index.
Pydantic Evals now gracefully handles custom TracerProviders without add_span_processor.
Handles OpenAI content filter refusals.
Handles content filter refusals reported through Google prompt_feedback.
Groq tool_use_failed errors without a tool name or arguments are handled by retrying.
Python 3.14 is supported.
Fixed AG-UI parent_message_id handling for back-to-back builtin tool calls.
Retry suggestions only recommend calling a tool when tools are available.
XAI now lazily creates an AsyncClient per event loop to avoid gRPC loop mismatch.
Fixes base64 decoding for A2A FilePart image and file uploads.
Fixes Bedrock
CachePointplacement when there are multiple trailing documents.Adds the missing union discriminator to prevent incorrect deserialization.
Fixes an error when a compatible provider returns reasoning_tokens as None.
Handles non-primitive types in BaseModel values.
Sends reasoning content back via the field it was received in.
Fixes caching when a user message ends on non-text content.
Fixes an error when Gemini calls tools in an agent run with instructions but no user prompt.
Fixes serialization of BinaryContent returned by a tool in Temporal.
Fixes Temporal serialization of DocumentUrl when it has a custom media_type.
Retries instead of raising an error when Google returns 0 candidates.
Corrects the OpenAI literal from 'in-memory' to 'in_memory'.
Types now match Vercel AI SDK v6.
Mistral streaming JSON mode now applies model_settings.
Embeddings APIs that omit usage are now supported.
Thought signatures and other provider metadata now survive a round trip through a Vercel AI frontend.
function_schema() now uses get_type_hints() when building function schemas.
Gemini now includes the user prompt when continuing a conversation that ended on structured output.
Sets a timeout in Google HttpOptions to prevent requests from hanging indefinitely.
Makes
count_tokens()work onWrapperModel.Fixes OpenAI not populating dict[str, ...] tool arguments.
Cancels tool calls when Agent.run or Agent.run_stream_events is cancelled.
Raises ContentFilterError consistently when a model response is empty because of a content filter.
Prevents an error when Mistral returns a ReferenceChunk.
Preserves a custom payload_codec.
PydanticAIPlugin respects PydanticPayloadConverter subclasses.
At the end of streaming, stream_output() calls the output function or validator with partial_output=False.
Fixes input_tokens calculation for Bedrock models.
Fixes duplicated tool calls when partial_output=False and caches the result.
Fixes the partial_output flag during streaming.
Updates thoughtSignature for Vertex Gemini 3 compatibility.
ThinkingPart is now handled in MCP Sampling.
Media type inference now works for URLs with query parameters.
GCS URIs on google-vertex now respect VideoUrl.vendor_metadata.
get_output() no longer creates duplicate messages when stream_output() has already been called.
ToolRetryError now sets its message.
Preserves the type field when converting const to enum in Google JSON schema transformation.
Operates on a deep copy of
$defsinstead of the original schema, avoiding modification of the original schema.Fixes a typing issue when dispatching requests with an agent that has output_type.
Makes the __init__ overloads less restrictive.
Fixes using synchronous history processors, instructions functions, and output functions with TemporalAgent.
Passes s3:// file URLs directly to the API.
The typing for UIAdapter.dispatch_request was fixed.
Fixes handling of the web search find_in_page action.
Compatibility with openai v1 is restored.
Fixes GraphBuildingError when using g.stream multiple times.
Fixes a BedrockConverseModel error when ModelResponse.parts is empty.
Broken resource errors are suppressed when cancelling.
The container_id is now passed back to the Anthropic API.
Fixes streaming tool calls so the GoogleModel thinking signature is stored.
Fixes errors when an OpenRouter response includes file annotations.
Streamed OpenRouter reasoning details can now omit content.
Bedrock geo prefixes now support us-gov. and other multi-character prefixes.
Copies extra_headers so model_settings can be reused.
Fixes structured output with nested definitions when using Gemini via OpenRouter.
TTL is automatically omitted from cache_control when AnthropicModel is used with a Bedrock client.
The behavior of FallbackModel on ValidationErrors is clarified.
FastMCPToolset now works with DBOS.
Fixes an error when the OpenRouter API returns
Nonefor tool call arguments.Fixes an error when
native_finish_reasonisNone.Returns tool errors to Google in the
errorkey.Fixes
GeneratorExithandling inpydantic_graph.beta.GraphRun.A custom httpx client provided to
MCPServerHTTPis no longer closed by the server.Uses the
model_nameproperty in the chat completion create request.Ensures the
openrouter_reasoningmodel setting is sent to the API.Google messages with zero parts are no longer sent.
An empty ThinkingPart is no longer inserted when a Google response ends in text with a thought_signature.
Fixes structured output and tool call thought signatures for the deprecated GeminiModel.
A model request is no longer skipped when history ends on a response but new instructions are present.
Fixes nested tool argument schemas by removing title from $defs.
Changes handling of empty state objects for AG-UI.
Wraps google.genai.errors.APIError in ModelHTTPError so it works with FallbackModel.
Updates has_content to check content data.
Makes RunContext.usage available with Temporal.
Fixes Gateway with Temporal by adding sniffio to sandbox passthrough modules.
Fixes a bug with running graphs in temporal workflows.
Restores upstream_provider for developers using the gateway.
Errors are wrapped in ModelHTTPError so BedrockConverseModel works well with FallbackModel.
ModelRetry is now hashable.
Vercel AI tool input and output now appear as objects rather than JSON strings.
Fixes an error when Google returns only empty text parts.
GoogleModel ignores empty text parts.
Updates the known models on Cerebras and Heroku.
Fixes resumed agent runs incorrectly treating a tool call as approved when history ends with an unapproved tool call.
Fixes a task cancellation bug in the graph beta API triggered by using MCPServerStreamableHTTP with agent.run_stream.
Fixes the type annotation for DuckDuckGoTool with the latest version of ddgs.
Corrects handling for OpenAI gpt-5-chat, which does not support encrypted reasoning.
Fixes graph execution when multiple joins are downstream of the same fork.
Fixes type variable variance for agent dependencies.
Fixes error handling with Temporal.
Fixes types so
OpenRouterProvidercan be created with onlyhttp_client.Prevents AG-UI events from using a
parent_message_idfrom a previous request or response.An empty Google response with MALFORMED_FUNCTION_CALL or another recoverable finish reason now triggers a retry instead of an error.
AG-UI frontend state is set directly on the provided deps, making it readable from the on_complete handler.
OpenAIResponsesModel now respects the openai_supports_tool_choice_required model profile setting.
Agent name inference was fixed when using run_stream_events.
Fixes pydantic-graph importing pydantic-ai.
Sanitizes the auto-generated output tool name to support generic types.
Ensures ToolCallPart.args resulting from TestModel(custom_output_args=...) is always a dict.
google-genai no longer closes an httpx client provided by Pydantic AI or the user.
Uses the correct agent's instructions when telling the model to retry output.
Fixes usage extraction for Anthropic.
Ignores empty text deltas when streaming gpt-oss on Bedrock.
Ignores empty text deltas when streaming gpt-oss via Ollama.
Nests toolset spans, including MCP sampling spans, under the agent run span.
Markdown fences are stripped when generating evals datasets.
The agent span includes the final_result attribute after streaming.
Instructions are recorded on the agent run span even when they are dynamic.
Updates the Gateway provider base URL.
AG-UI text message content events with empty text part deltas are no longer emitted.
Empty AG-UI thinking message events are no longer emitted.
Fixes usage counting for Anthropic streaming.
Fixes streaming when the async content filter is enabled.
Streaming thinking signature deltas are now handled.
Errors in evals are now handled gracefully.
Fixes streaming errors when Gemini responses include only executable_code or code_execution_result.
Groq tool_use_failed errors are handled by asking the model to retry.
The original response is now closed when retrying an HTTP request.
ModelRequest.parts is now typed as Sequence.
Old ModelResponses stored in a database can still be deserialized.
ModelResponse.parts is now typed as Sequence.
Separate OpenAI Responses reasoning summary parts now produce separate ThinkingParts.