github pydantic/pydantic-ai v2.68.0
v2.68.0 (2026-11-11)

one hour ago

What's Changed

⚠️ Compatibility Notes

  • Note text that looks like an application frame in user and tool content instead of escaping it by @DouweM in #11813
  • Add OutputTokenLimitExceeded, and fall back to the next model in ModelFallback when a response is cut off at max_tokens by @DouweM in #12407
  • Ask for approvals and answers inside the run with RequestInput, put AskUser on the deferred pipeline, and mark deferred calls with kind and answered_by by @DouweM in #12757
  • Add DelegationTasks.discover() and stop one damaged saved task from blocking DelegationTasks.opened() by @mpfaffenberger in #10140
  • Require workspace backends to leave detached processes running, and check it in WorkspaceBackendSuite by @mpfaffenberger in #13070
  • Run PromptInjectionDefender semantic classification as durable operations so it works on Temporal by @mpfaffenberger in #12424
  • Give sub-agent task-control events the Event suffix and past-participle names, with agent_name and parent_task_id fields, keeping the old names as deprecated aliases by @mpfaffenberger in #13074
  • Spell out abbreviated identifiers in pydantic_ai_harness, renaming num_results to max_results and max_duration_secs to max_duration_seconds by @mpfaffenberger in #13075
  • Rename harness CapabilityEvent fields to *_count, *_name, duration_ms and previous_item, keeping the old names as deprecated aliases by @mpfaffenberger in #13068
  • Rename harness CapabilityEvent outliers to <Subject><PastParticiple>Event and add STEP_PERSISTENCE_EVENTS by @mpfaffenberger in #13065

🚀 Features

  • Load and save UI adapter conversations through a ConversationStore with conversation_store by @DouweM in #12326
  • Use the AI Gateway's streamed cost for GoogleModel and BedrockConverseModel streams by @ddanielcruzz in #13168
  • Support running SubAgents delegations to durable delegates as Temporal and DBOS child workflows by @mpfaffenberger in #12516
  • Add the RefineOutput harness capability by @mpfaffenberger in #13120
  • Add a per-command cwd to Workspace.run by @mpfaffenberger in #12642
  • Require workspace backends to leave detached processes running, and check it in WorkspaceBackendSuite by @mpfaffenberger in #13070
  • Add DelegationTasks.discover() and stop one damaged saved task from blocking DelegationTasks.opened() by @mpfaffenberger in #10140
  • Bound the wait for the detached process to start in the WorkspaceBackendSuite reattach rule by @mpfaffenberger in #13081
  • Ask for approvals and answers inside the run with RequestInput, put AskUser on the deferred pipeline, and mark deferred calls with kind and answered_by by @DouweM in #12757
  • Add OutputTokenLimitExceeded, and fall back to the next model in ModelFallback when a response is cut off at max_tokens by @DouweM in #12407
  • Allow a CancellationToken fired from a workflow signal to cancel a Temporal durable run by @DouweM in #7210
  • Note text that looks like an application frame in user and tool content instead of escaping it by @DouweM in #11813
  • Add a GoogleDecisionsModel backend for the Gemini Decisions API by @dsfaccini in #13181

🐛 Bug Fixes

  • Resolve vendor/model ids through one case-insensitive family map on OpenAICompatibleProvider, LiteLLMProvider and TogetherProvider by @DouweM in #12743
  • Map unified thinking to reasoning_effort for Z.AI GLM and DeepSeek V3.2 on Bedrock by @EdAbati in #11491
  • Honor Permissions remembered approvals inside durable execution by @mpfaffenberger in #12410
  • Make AnthropicModel.count_tokens send the request's betas and raise its all-deferred tools UserError by @dsfaccini in #13098
  • Drop the account-age claim from AnthropicStaleThinkingBlockWarning, since Claude Fable 5.2 and Mythos 5.2 bind thinking blocks on every account by @dsfaccini in #13155
  • Run PromptInjectionDefender semantic classification as durable operations so it works on Temporal by @mpfaffenberger in #12424
  • Carry ModelResponse.canonical_system through the Vercel AI and AG-UI event streams by @DouweM in #13134
  • Lower a max_tokens above a Claude model's maximum output to it instead of sending it by @DouweM in #12427
  • Report when TieredCompaction can't reach target_tokens because its tiers keep more than the target by @DouweM in #12650
  • Summarize the tail messages SummarizingCompaction(keep_user_messages=True) copies displace instead of dropping them by @DouweM in #12652
  • Complete a Gemini Live turn that ends silently after a tool result by @DouweM in #13126

📦 Dependencies

  • Raise the genai-prices floor to 0.2.3 so Anthropic fast mode responses are priced at fast mode rates by @dsfaccini in #13104

New Contributors

Full Changelog: v2.67.0...v2.68.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.