Source · release
Pydantic AI v2.76.0: mid-session tool updates and Code Mode final output
Summary
Pydantic AI v2.76.0 (2026-11-26) lets realtime voice sessions change their tool set without reconnecting, lets Code Mode scripts return the run's final output, and adds stateless support for Google's Interactions API. It also brings desktop computer-use sandboxes to Pax. This note is based on the release notes only.
Key points
- Realtime tool updates: models whose profile sets
RealtimeModelProfile.supports_tool_updatesaccept a newUpdateToolsinput to add or remove tools mid-session. - Code Mode output:
CodeMode(allow_final_output=True)lets sandboxed code submit the agent's final result directly, saving a round trip through the model. - Google:
GoogleInteractionsModelgains stateless Interactions support. - UI control: a per-tool
ui_visibilitysetting keeps chosen tool results out of the client in UI adapters. - Pax:
/computer-usedesktop sandboxes, clickableStatusLinkplugin segments, and apydantic-ai-paxextra that installs every provider. - Tracing: nested agent spans record
pydantic_ai.root_conversation_id. - Check before upgrading:
UpdateToolsbreaks exhaustiveassert_nevermatches onRealtimeInput;gemini-2.5-proandgemini-2.5-flashnow raiseDeprecatedModelWarning;FileSystem.read_fileoffsets are now 1-indexed. - Upgrade with
pip install -U pydantic-ai.
Why it matters
Changing tools mid-session matters for voice agents that move between tasks, and letting Code Mode return output directly makes code-execution agents cheaper. Both continue Pydantic AI's fast weekly cadence.