github pydantic/pydantic-ai v2.76.0
v2.76.0 (2026-11-26)

one hour ago

What's Changed

⚠️ Compatibility Notes

  • Reveal tools mid-session in realtime sessions on models that take tool updates, via RealtimeModelProfile.supports_tool_updates and UpdateTools by @DouweM in #12440
    • RealtimeInput, the union RealtimeConnection.send accepts, gains UpdateTools, and DEFAULT_REALTIME_PROFILE gains supports_tool_updates: False. A session sends UpdateTools only to a connection whose model's profile sets supports_tool_updates, so an existing connection never receives it, but an exhaustive match over RealtimeInput (assert_never) stops type-checking. Handle UpdateTools there, or raise for it.
  • Warn with DeprecatedModelWarning on requests to gemini-2.5-pro and gemini-2.5-flash by @dsfaccini in #14679
    • A request to gemini-2.5-pro or gemini-2.5-flash through GoogleModel or GoogleInteractionsModel now emits DeprecatedModelWarning, a UserWarning, so code that turns warnings into errors, such as filterwarnings = error, fails on those requests. Move to the replacement the warning names, or keep the model meanwhile by filtering the warning or setting profile={'deprecation': None}.
  • Select a word on double-click and a line on triple-click in pax by @dsfaccini in #14558
    • Selection.feed, span, highlight and text in pydantic_ai_pax.ui.prompt.prompt_selection take new arguments: feed takes the press time as now, span takes the painted frame and the soft-wrap flags joins in place of width, and highlight and text take joins. A drag across a row the panel wrapped no longer copies a newline at the wrap.
  • Add /computer-use desktop sandboxes to Pax by @adtyavrdhn in #14564
    • A Pax plugin status segment may now return a StatusLink, which the status row shows as a clickable link, as well as a str. A segment that returns str works as before.
  • Add a pydantic-ai-pax extra for every model provider, plus all, and install the Google SDK by default by @DouweM in #14614
    • pydantic_ai_pax.cli.self_update.PACKAGES, the packages /update reinstalls, now asks for pydantic-ai-slim[anthropic,google,mcp,openai], following Pax's default install, which now includes the Google SDK. No migration is needed.
  • Keep every message a run adds in result.conversation when a capability trims the history mid-run by @DouweM in #13211
    • An app that carries result.conversation into the next run in memory, with a capability that summarizes the history (SummarizingCompaction, RelevanceCompaction), now has the full history summarized on each run instead of carrying the last summary. To carry the compacted history instead, pass result.all_messages() as message_history=, saving result.conversation to a store first if you want to keep the dropped messages. In UI adapters in server mode with a trimming capability, ReinjectSystemPrompt now stores the run's own request with the system prompt at its head instead of a copied turn.
  • Make FileSystem read_file offset 1-indexed by @adtyavrdhn in #13250
    • FileSystemToolset.read_file(..., offset=N) called from Python, and ReadFileArgs or ReadFileCallPart built with an explicit offset, now start one line earlier, and offset=0 raises (a retry for models). Where you pass offset=N, pass N + 1; find those calls with grep -rn "read_file(.*offset" ..

🚀 Features

  • Reveal tools mid-session in realtime sessions on models that take tool updates, via RealtimeModelProfile.supports_tool_updates and UpdateTools by @DouweM in #12440
  • Forward volumes through OpenSandboxBackend to Sandbox.create by @pydanty in #14282
  • Add stateless Google Interactions support with GoogleInteractionsModel by @dsfaccini in #12636
  • Add CodeMode(allow_final_output=True) to submit the run's output from sandboxed code by @DouweM in #11349
  • Record pydantic_ai.root_conversation_id on spans of nested agent runs so sub-agent cost rolls up to the outer conversation by @adtyavrdhn in #14664
  • Derive delegated task IDs from the run and tool call outside durable execution too by @DouweM in #13419
  • Add per-tool ui_visibility so UI adapters can keep tool results from the client by @dsfaccini in #14645
  • Warn with DeprecatedModelWarning on requests to gemini-2.5-pro and gemini-2.5-flash by @dsfaccini in #14679
  • Raise ModelSchemaTooComplexError for Anthropic's "Schema is too complex" 400, and attempt an inferred Native Output schema again in Tool Output by @DouweM in #11781
  • Select a word on double-click and a line on triple-click in pax by @dsfaccini in #14558
  • Add /computer-use desktop sandboxes to Pax by @adtyavrdhn in #14564
  • Add a pydantic-ai-pax extra for every model provider, plus all, and install the Google SDK by default by @DouweM in #14614
  • Keep Pax config and state in pydantic-ai-pax folders by @DouweM in #14615

🐛 Bug Fixes

  • Drop Anthropic sampling settings when the client sends API version 2026-10-21, the anthropic>=2 default by @DouweM in #14420
  • Keep every message a run adds in result.conversation when a capability trims the history mid-run by @DouweM in #13211
  • Make FileSystem read_file offset 1-indexed by @adtyavrdhn in #13250
  • List the modules Monty 1.7 added in the CodeMode run_code description by @dsfaccini in #14575
  • Stop Temporal and Prefect from retrying UsageLimitExceeded by @dsfaccini in #14205
  • Publish the agent spec parameters of AskUser, IPythonCodeMode, PromptInjectionDefender and ToolBridge, and check every spec schema against the classes it loads by @dsfaccini in #13982
  • Raise IncompleteToolCall when the token limit cuts off an Anthropic output tool call, instead of retrying by @DouweM in #14409
  • Raise UserError for immediate capability events in a Render child task by @DouweM in #14524
  • Keep the Pax web UI's Changes count current when a turn starts right after one that changed files by @dsfaccini in #14589
  • Read Coder's project skills like the session's LocalWorkspace when a plugin adds a capability function by @dsfaccini in #14680
  • Show a claimed speculative call before later calls in Pax's sandbox call display by @dsfaccini in #14692

Full Changelog: v2.75.0...v2.76.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.