Pydantic AI 2.76.0 Lets Realtime Sessions Add Tools Mid-Run

Pydantic AI 2.76.0, released 26 November 2026, adds mid-session tool updates for realtime sessions, a stateless Google model, and Gemini 2.5 warnings.

Pydantic AI 2.76.0 arrived on 26 November 2026, and it is the kind of minor release that rewards reading the compatibility notes before running the upgrade. The headline feature is mid-session tool updates for realtime models, which lets a running voice or live session gain new tools without reconnecting. Around it sit a stateless model for Google Interactions, a way for sandboxed code to submit a run’s output, and three changes that can break existing code: a deprecation warning for Gemini 2.5 models, a one-based line offset in the file toolset, and a different answer to what result.conversation keeps after history trimming. This article works from the v2.76.0 release notes and the project’s upgrade guide, which collects the compatibility notes for every V2 minor release.

The release lands in the middle of a fast week for the project. The upgrade guide lists compatibility notes for v2.73.0, v2.74.0, and v2.75.0 in the same stretch, covering an OpenAI dependency floor raise, a workspace instruction authority boundary, and new Playwright browser restrictions. Version 2.76.0 continues that pattern: it adds real capability, and it moves a few defaults that existing applications were quietly relying on. The sensible way to read it is as a checklist. The features are easy to adopt. The compatibility notes are the part that decides whether the upgrade is a ten-minute job or an afternoon of debugging.

Realtime sessions can reveal tools mid-run

Realtime models in Pydantic AI run over a persistent connection, and until this release the toolset a session could call was fixed when the session started. Version 2.76.0 adds UpdateTools to RealtimeInput, the union type that RealtimeConnection.send accepts, and adds supports_tool_updates to RealtimeModelProfile. A session now sends an UpdateTools message to a connection whose model profile sets that flag, and the model can start calling the newly revealed tools without the session reconnecting.

The default keeps existing behavior untouched. DEFAULT_REALTIME_PROFILE gains supports_tool_updates: False, so a session never sends UpdateTools unless the model behind it opts in. That matters because the feature only works on models that accept tool updates mid-session, and sending the message to one that does not would fail in a way that is hard to diagnose from the application side. The release notes frame this as a compatibility item rather than a pure feature, and the reason is the type-level break: any code that matches exhaustively over RealtimeInput, for example with assert_never, stops type-checking until it handles the new UpdateTools variant. The fix is small, either handle the variant or raise for it, but it is the kind of break that a type checker finds and a test suite may not, so it is worth searching for before upgrading.

The practical use is a session whose tools depend on what the user has already said. A voice agent that starts with a general set of tools can reveal a payment tool only after the user asks to check out, or a support agent can reveal an account lookup tool only after the caller has been identified. Before this release the usual workaround was to open a second session or to expose every tool from the start and gate them with instructions, which put access control into the prompt instead of the session. Mid-session updates move that decision back into code, where it can be tested. The change is narrow: it touches one union type, one profile flag, and nothing else in the realtime path.

A stateless model for Google Interactions

The second feature is GoogleInteractionsModel, a model class for stateless Google Interactions. Pydantic AI already had GoogleModel for the stateful Google API path, and the new class covers the stateless Interactions API, where each request carries its own context instead of relying on a server-side session. The release notes list it as a plain feature with no compatibility notes attached, which is a sign that it is additive: nothing existing changes when it arrives.

Stateless interactions suit a different shape of application from the stateful path. A serverless function, a queue worker, or an HTTP handler that spins up per request does not want to hold a session open between calls, and it does not want to pay the cost of recreating session state on every invocation. The stateless model takes the conversation history as part of each request, so the application keeps the history itself and hands it over each time. That is the same trade-off Pydantic AI makes everywhere else with message_history, and the new model brings Google’s Interactions API into that pattern.

It also matters for the deprecation warning below, because the warning fires through both model classes. A request to gemini-2.5-pro or gemini-2.5-flash through GoogleModel or through the new GoogleInteractionsModel emits the same DeprecatedModelWarning. Teams adopting the new class for a fresh integration get the warning on day one if they pick a 2.5 model, which is the correct time to notice it, before the model id is baked into configuration and deployment scripts.

CodeMode can hand back the run output

CodeMode runs model-generated code inside a sandbox, and version 2.76.0 adds CodeMode(allow_final_output=True), which lets sandboxed code submit the run’s output. The release notes describe it in one line, and the use case is straightforward: when the code in the sandbox has computed the answer, it should be able to hand that answer back as the run’s result instead of the agent having to fetch it out through another tool call or another round of messages.

This closes a small gap in the sandboxed workflow. Before the change, code that ran in the sandbox produced its results inside the sandbox, and the agent needed a separate step to retrieve them and present them. With the flag set, the submission step is part of the code execution itself. The flag is opt-in, so existing CodeMode setups behave exactly as before, and the change pairs with another sandbox item in the same release: OpenSandboxBackend now forwards volumes through to Sandbox.create, so a sandboxed run can mount the storage it needs and then submit its output from it.

Two smaller observability items ship alongside. Nested agent runs now record a pydantic_ai.root_conversation_id span attribute, so the cost of a sub-agent rolls up to the outer conversation in tracing tools instead of appearing as an orphaned span. And a per-tool ui_visibility setting lets UI adapters keep a tool result from the client, which is useful when a result is large, sensitive, or only meaningful to the server. Neither changes behavior on its own. Together they make a multi-agent run easier to watch and easier to present, which is the part of agent work that usually gets built last and debugged first.

Three changes to check before upgrading

The compatibility notes carry three items that can break a running application, and they deserve a direct read rather than a skim.

The first is the Gemini 2.5 deprecation warning. Requests to gemini-2.5-pro and gemini-2.5-flash through GoogleModel or GoogleInteractionsModel now emit DeprecatedModelWarning, a UserWarning. Any test suite or service that runs with filterwarnings = error fails on those requests, which is the intended effect: the warning is meant to surface before the provider retires the model and the API starts failing. The release notes give three ways forward, move to the replacement the warning names, filter the warning, or set profile={'deprecation': None}. The upgrade guide adds context from v2.73.0, which introduced the same warning for deprecated Anthropic and OpenAI models, so this is the project applying one policy across providers rather than a one-off for Google. The right response depends on the codebase. A pinned model id in configuration is a one-line change. A model id chosen at runtime from user input needs a mapping, and the warning is the prompt to build it.

The second is the file offset change. FileSystemToolset.read_file now takes a 1-indexed offset, where it used to take a 0-indexed one. A call that passed offset=N now starts one line earlier, and offset=0 raises instead of returning the first line. The same applies to ReadFileArgs and ReadFileCallPart built with an explicit offset. The release notes tell readers to pass N + 1 wherever they passed N, and to find those calls with grep -rn "read_file(.*offset" .. The break is silent in the worst case: an off-by-one in a file read does not raise, it returns the wrong lines, and a model reading a file with the wrong window can act on the wrong content. The offset change is the one item in this release where a grep is not optional, because the failure mode is a wrong answer rather than an error.

The third is the history retention change. When a capability trims the history mid-run, such as SummarizingCompaction or RelevanceCompaction, result.conversation now keeps every message the run added, instead of keeping only the compacted form. An application that carries result.conversation into the next run now has the full history summarized on each run instead of carrying the last summary forward. To carry the compacted history instead, pass result.all_messages() as message_history=, saving result.conversation to a store first if the dropped messages need keeping. The trade-off is between completeness and cost: keeping everything is safer for debugging and for audits, and it costs more tokens on every subsequent run. Applications that run long conversations with compaction enabled should check which of the two values they are passing forward, because the default answer changed under them.

The Pax terminal agent gets its own set of changes in the same release. It gains /computer-use desktop sandboxes, a pydantic-ai-pax install extra for every model provider plus an all extra, and the Google SDK installed by default. Pax configuration and state now live in pydantic-ai-pax folders. None of these change how an existing Pax setup runs, but the default install is heavier than before, and a team that pins the Pax package list should expect the Google SDK to arrive with it.

What the smaller fixes change in practice

The bug fix list is long, and three items in it change behavior that applications can feel. Anthropic sampling settings are now dropped when the client sends API version 2026-10-21, the default for anthropic>=2, which removes a source of rejected requests for teams that upgraded the Anthropic SDK without touching their sampling configuration. Temporal and Prefect no longer retry UsageLimitExceeded, which stops a durable workflow from burning through its retry budget on an error that will not resolve by retrying. And when the token limit cuts off an Anthropic output tool call, the run now raises IncompleteToolCall instead of retrying, so the application sees a clear signal that the call was truncated rather than watching a retry loop produce the same truncated call again.

A fourth fix is worth noting for schema-heavy tools. The run now raises ModelSchemaTooComplexError for Anthropic’s “Schema is too complex” 400 response, and attempts an inferred Native Output schema again in Tool Output mode. A schema that was too complex used to surface as a generic API error; now it has a name, and the retry path gives the run a second chance with a simpler inferred schema. These are the fixes that do not make a headline, and they are also the ones most likely to show up as fewer 3 a.m. pages: a retry that stops retrying, an error that names itself, a truncated call that says so.

How to check the upgrade yourself

Every claim in this article comes from the release notes and the upgrade guide linked at the top. No local benchmark or test run sits behind it, and the verification below is written so a reader can repeat it on their own machine rather than taking the article’s word for it.

Start by confirming the installed version and the release notes side by side. Run pip show pydantic-ai and compare the version with the releases page, then read the compatibility notes for v2.76.0 on that page and the matching entries in the upgrade guide for v2.73.0 through v2.75.0, since the week’s releases share the same deprecation policy. Next, search the codebase for the two breaking items that fail silently or fail in CI: run grep -rn "read_file(.*offset" . and adjust each match from offset=N to offset=N + 1, and run the test suite with filterwarnings = error to catch any Gemini 2.5 request that now warns. Then check the history handling: find where result.conversation is passed into the next run and decide whether it should stay, or switch to result.all_messages() as message_history=. Finally, pin the version explicitly with pip install "pydantic-ai==2.76.0" in a fresh environment and run the application’s agent test suite there before changing the pin in production. The install line is the reader’s own check, not a claim from the article, and a green suite on the pinned version is the evidence that the upgrade is safe for that codebase.

Our take

Version 2.76.0 is a useful release for teams already running Pydantic AI in production, and a risky one to install blind. The realtime tool updates and the stateless Google model are genuine additions, and the CodeMode output flag removes a real annoyance from sandboxed workflows. The breaking changes are all documented, all small, and all capable of producing a confusing failure if they are missed: a type error in CI, a warning turned into an error, a file read that returns the wrong lines, a conversation that quietly grows more expensive. The project’s release pace makes the discipline matter more, not less. With compatibility notes arriving in v2.73.0, v2.74.0, v2.75.0, and v2.76.0 inside a single week, the upgrade guide is the document to read first, and the version pin is the control that makes the reading stick. Pin 2.76.0, run the three checks above, and then take the features.

Readers tracking the same release cadence may also want the earlier coverage of Transformers 5.24.0, which followed a similar pattern of a rename with a patch three days later, and the TabICL comparison for a sense of how new tabular methods stack up against the established libraries. The MCP server guide is the place to start if the FileSystemToolset offset change prompts a wider look at how Pydantic AI tools are wired.

Share this article

X Facebook LinkedIn Reddit Telegram

Your notes on this article

Your name or initials, note and date stay in this browser profile. Anyone using the profile can read them. Delete a note below or clear this site’s browser data. To reach the editors, report a correction.

No notes saved here