pypi pydantic-ai 2.67.0
v2.67.0 (2026-11-10)

13 minutes ago

What's Changed

⚠️ Compatibility Notes

  • Support SubAgents(dynamic_agents=...) under durable execution by @mpfaffenberger in #12418
  • Strip every default-ignorable character before ArtifactScanner phrase matching and flag hidden variation selectors by @mpfaffenberger in #11475
  • Load one instruction file per directory and nested files by default in RepoContext, add walk_up, and have Coder build on them by @DouweM in #11691
  • Cap inlined nested instructions at 32,000 characters per conversation by default with RepoContext(nested_max_chars=...) by @DouweM in #11699
  • Send documents of any media type mimetypes knows, with the format taken from it by @arjun-krishna1 in #12365
  • Move provider-specific native-tool fields to provider_settings by @adtyavrdhn in #7807
  • Add framing_announcement setting and only announce the <system> voice tag once a conversation needs it by @DouweM in #12661
  • Surface nested RepoContext instruction files when the model writes or edits in a directory by @DouweM in #11701
  • Record InputGuardrail, OutputGuardrail and ToolGuardrail verdicts as durable operations by @mpfaffenberger in #12428
  • Refuse a CapabilityCreation run when directory is below 'operator' authority by @DouweM in #12558
  • Stop continuing an OpenAI response without a history_digest through openai_previous_response_id by @DouweM in #12575
  • Replay Prefect tasks on flow retry when the message history holds binary content by @sangkyoonnam in #12188
  • Reject CodeMode tools named after Python builtins, which the sandbox called instead of the tool by @adtyavrdhn in #12698
  • Break chat-template special tokens in content on open-model routes, and restore them in model output, with ModelProfile.may_tokenize_special_tokens_in_content by @DouweM in #12556
  • Use the engine's codec and serialization_failure for durable capability results by @maksimzayats in #11057
  • Send FileSearchTool.max_num_results to OpenAI Responses by @adtyavrdhn in #12728
  • Raise UserError when validation requests approval for an external tool, keep single-model tool arguments through durable re-validation, and document concurrent DBOS runs and shared MCP http_clients by @dsfaccini in #12958
  • Record a StepPersistence tool call that ends in ModelRetry or ToolFailed as failed instead of leaving it started by @dsfaccini in #12638
  • Raise UserError from StreamedRunResult.result when a run_stream() run stops while finishing by @dsfaccini in #13087
  • Run CodeMode remote sandboxes over gRPC with pydantic-monty 1.5.0 by @dmontagu in #12673
  • Replace httpx with httpx2 in pydantic-ai-harness by @Kludex in #13026
  • Curate KnownModelName and the provider model-name literals to the models a user would pick by @dsfaccini in #12817

🚀 Features

  • Add dequeue and set_enqueue_priority to change a message queued with enqueue before delivery by @adtyavrdhn in #12345
  • Support SubAgents(dynamic_agents=...) under durable execution by @mpfaffenberger in #12418
  • Run tool calls as DBOS child workflows via child_workflow tool metadata in DBOSDurability by @mpfaffenberger in #12445
  • Checkpoint TrajectoryJudge evaluations as a durable operation when the judge has an id by @mpfaffenberger in #12414
  • Identify Azure Durable Task workers with pydantic-ai in their gRPC user agent by @tamirdresher in #12493
  • Add client to ModalSandbox and ModalSandboxBackend by @adtyavrdhn in #12501
  • Strip every default-ignorable character before ArtifactScanner phrase matching and flag hidden variation selectors by @mpfaffenberger in #11475
  • Add client to E2BSandbox and E2BSandboxBackend by @adtyavrdhn in #12500
  • Add per-path workspace authority with Workspace.authority_of by @DouweM in #12473
  • Add openai_include_unmapped_response_data to keep Chat Completions response data Pydantic AI doesn't map by @DouweM in #12034
  • Load one instruction file per directory and nested files by default in RepoContext, add walk_up, and have Coder build on them by @DouweM in #11691
  • Cap inlined nested instructions at 32,000 characters per conversation by default with RepoContext(nested_max_chars=...) by @DouweM in #11699
  • Support OpenAI fast and ultrafast service tiers in openai_service_tier by @adtyavrdhn in #12527
  • Send documents of any media type mimetypes knows, with the format taken from it by @arjun-krishna1 in #12365
  • Run DBOS child-workflow tools in parallel when a workspace is attached by @mpfaffenberger in #12522
  • Add the KeenableSearch capability for keyless web research by @ilya-bogin-keenable in #9079
  • Add gateway/bedrock:global.moonshotai.kimi-k3 and gateway/bedrock:global.moonshotai.kimi-k3.1 to KnownModelName by @dsfaccini in #12869
  • Add provider-specific settings to native tools by @adtyavrdhn in #7633
  • Support Anthropic web_search_20260318 and web_fetch_20260318 via provider_settings by @adtyavrdhn in #12610
  • Move provider-specific native-tool fields to provider_settings by @adtyavrdhn in #7807
  • Support SubAgents(task_control=...) under Temporal and DBOS durability by @mpfaffenberger in #12521
  • Support OpenAI's gpt-image-2.6-flare and gpt-image-2.6-sunburst image models by @dsfaccini in #12820
  • Add Claude Fable 5.2 (claude-fable-5-2) and Claude Mythos 5.2 (claude-mythos-5-2) support by @dsfaccini in #12970
  • List Claude Fable 5.2 on Bedrock (global.anthropic.claude-fable-5-2) and send per-message effort to it on OpenRouter by @dsfaccini in #13037
  • Support Gemini 4 Carbon (gemini-4-carbon) on GoogleModel by @dsfaccini in #13057
  • Add framing_announcement setting and only announce the <system> voice tag once a conversation needs it by @DouweM in #12661
  • Surface nested RepoContext instruction files when the model writes or edits in a directory by @DouweM in #11701

🐛 Bug Fixes

  • Record InputGuardrail, OutputGuardrail and ToolGuardrail verdicts as durable operations by @mpfaffenberger in #12428
  • Stop commands under crun 1.14.1 in DockerSandbox and build AsyncDaytona off the event loop by @adtyavrdhn in #12509
  • Record Advisor, SmartSearch and ConversationSearch tool I/O as durable operations by @mpfaffenberger in #12415
  • Include rejected FallbackModel attempts in the usage BrowserUse reports to browser-use by @mpfaffenberger in #11879
  • Publish BoxdSandbox fields in the agent spec schema by @adtyavrdhn in #12518
  • Publish DaytonaSandbox fields in the agent spec schema by @adtyavrdhn in #12517
  • Publish RenderSandbox fields in the agent spec schema by @adtyavrdhn in #12520
  • Publish SpritesSandbox fields in the agent spec schema by @adtyavrdhn in #12519
  • State a loaded capability's instructions where the load is when a UI client sends its history back by @DouweM in #11775
  • Send Gemini tool returns that contain a $ref key as JSON text, which Gemini otherwise rejects by @DouweM in #12429
  • Make Temporal wait a model error's retry_after before retrying the model request activity by @DouweM in #12106
  • Raise right away when the token limit cuts off NativeOutput or PromptedOutput text that fails validation, instead of retrying by @DouweM in #12406
  • Raise ModelQuotaExceededError for the Gemini API's daily quota and disabled billing, and Moonshot's exhausted balance by @DouweM in #12422
  • Attribute tool-result instructions to their source in the default summary prompt by @pydanty in #12506
  • Keep tool search discoveries across SummarizingCompaction, SlidingWindowCompaction and RelevanceCompaction by recording them again as a ToolAvailabilityDeltaPart by @DouweM in #11773
  • Record an exception raised in a UI adapter's on_complete on the current OpenTelemetry span by @DouweM in #12541
  • Stop sync runs warning There is no current event loop on Python 3.12 and 3.13 by @DouweM in #12540
  • Accumulate Mistral streamed tool-call deltas into one tool call by @pydanty in #11958
  • Send the max_tokens setting to DeepSeek as max_tokens instead of max_completion_tokens by @dsfaccini in #12385
  • Drop WebSearchTool from non-compound GroqModel profiles so web search fallbacks run by @dsfaccini in #12386
  • Raise UserError from JsonSchemaTransformer on nodes that are not JSON Schemas by @adtyavrdhn in #8620
  • Keep a Shell job's log within max_log_bytes when the job ends as its log watcher starts by @dsfaccini in #12578
  • Walk up to a RepoContext.home_dir spelled through a symlink by @dsfaccini in #12614
  • Give every FunctionSignature type one name and one definition in rendered tool catalogs by @adtyavrdhn in #12513
  • Send ClampOversizedMessages and ClearToolResults edits without the item ID that makes OpenAI Responses ignore them by @DouweM in #12561
  • Fix diff rendering pointing the wrong way for negative baselines by @arthi-arumugam-git in #7497
  • Refuse a CapabilityCreation run when directory is below 'operator' authority by @DouweM in #12558
  • Stop continuing an OpenAI response without a history_digest through openai_previous_response_id by @DouweM in #12575
  • Replay Prefect tasks on flow retry when the message history holds binary content by @sangkyoonnam in #12188
  • Render keyword and non-identifier tool parameter and field names as valid Python in CodeMode and IPythonCodeMode by @dmontagu in #12669
  • Reject CodeMode tools named after Python builtins, which the sandbox called instead of the tool by @adtyavrdhn in #12698
  • Stop max_retries raising a TypeError on AsyncAnthropicBedrock clients with anthropic 2.6 by @dsfaccini in #12707
  • Cap google-genai<3 so fresh installs keep GoogleModel on the v1beta Gemini API by @dsfaccini in #12700
  • Emit results of tool calls that finish together in call order, so Temporal replays hand event_stream_handler the recorded events by @dsfaccini in #12675
  • Retry FileSystem search_files patterns whose repeat count overflows re, such as a{99999999999}, instead of aborting the run by @dsfaccini in #12726
  • Stop a Shell job's supervisor and log watcher outliving a command that removes its job directory by @dsfaccini in #12730
  • Break chat-template special tokens in content on open-model routes, and restore them in model output, with ModelProfile.may_tokenize_special_tokens_in_content by @DouweM in #12556
  • Record dropped Anthropic cache points in model-request telemetry by @pydanty in #12510
  • Update CerebrasProvider reasoning flags for Qwen 3.8, Kimi K3 and GLM-5.3 by @DouweM in #12746
  • Raise CodeMode setup errors to callers, correct timeout advice, and reset local and remote sessions after memory/output limits by @dmontagu in #12689
  • Stop SpritesSandboxBackend.run raising a TypeError for a non-number timeout by @dsfaccini in #12729
  • Fix the Shell job supervisor hang when a command removes its job directory or makes it read-only by @dsfaccini in #12814
  • Send one User-Agent header on Google requests by @dsfaccini in #12583
  • Report the exit code of a Shell job whose command makes its job directory read-only, and stop it without a retry by @dsfaccini in #12830
  • Fix Shell failing to stop a macOS job whose process group holds only zombies, and keep a failed call's own error when its stop fails too by @dsfaccini in #12858
  • Stop the gh-aw engine putting the checkout on sys.path ahead of installed packages by @dsfaccini in #12818
  • Use the engine's codec and serialization_failure for durable capability results by @maksimzayats in #11057
  • Send FileSearchTool.max_num_results to OpenAI Responses by @adtyavrdhn in #12728
  • Send an extra_headers user-agent in any spelling in place of ours on OpenAI, Anthropic and Groq requests by @dsfaccini in #12871
  • Merge an anthropic-beta header from extra_headers with the other Anthropic betas however its name is capitalized by @dsfaccini in #12875
  • Send a user-agent from extra_headers as one header line on Google requests by @dsfaccini in #12877
  • Send the Anthropic client's default_headers betas with ours, and accept a user-agent in batch extra_headers in any spelling by @dsfaccini in #12878
  • Raise UserError when validation requests approval for an external tool, keep single-model tool arguments through durable re-validation, and document concurrent DBOS runs and shared MCP http_clients by @dsfaccini in #12958
  • Send the lowest accepted effort for thinking=False on more OpenRouter mandatory-reasoning routes by @DouweM in #12744
  • Inline $defs in gpt-oss tool schemas by @DouweM in #12759
  • Fix ToolOutput for gpt-oss on BedrockMantleProvider by not forcing tool_choice by @DouweM in #12761
  • Treat the IPv6 prefixes ::ffff:0:0:0/96, 100:0:0:1::/64, 2001:2::/48, 3fff::/20 and 5f00::/16 as private addresses by @dsfaccini in #12953
  • Make the harness shell foreground wait replay the same workspace calls under durable execution by @mpfaffenberger in #12978
  • Announce task_backgrounded for a background task that settles before delegate_task resumes, as on durable replay by @dsfaccini in #13008
  • Keep tool_call_id on the tool call arguments the special-token restorer sends when a stream ends by @dsfaccini in #13062
  • Populate ModelAPIError.retry_after from Gemini's RetryInfo.retryDelay by @dsfaccini in #13077
  • Limit the total size of the file URLs one model request downloads by @dsfaccini in #12959
  • Record a StepPersistence tool call that ends in ModelRetry or ToolFailed as failed instead of leaving it started by @dsfaccini in #12638
  • Keep replayed durable work out of traces and token and cost metrics on AWS Lambda and Temporal by @DouweM in #12756
  • Price Anthropic fast mode responses at fast mode rates by recording provider_details['speed'] by @dsfaccini in #13083
  • Raise UserError from StreamedRunResult.result when a run_stream() run stops while finishing by @dsfaccini in #13087

📦 Dependencies

  • Move uv.lock to dbos 3.4.0 and launch DBOS from a FastAPI lifespan in the production example by @dsfaccini in #12568
  • Run CodeMode remote sandboxes over gRPC with pydantic-monty 1.5.0 by @dmontagu in #12673
  • Allow AWS durable execution SDK 2 and 3 in pydantic-ai-harness[aws-lambda], and correct the Lambda quota and replay docs by @DouweM in #12739
  • Replace httpx with httpx2 in pydantic-ai-harness by @Kludex in #13026

New Contributors

Full Changelog: v2.66.0...v2.67.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.