If your Pydantic AI voice application closes its realtime session as soon as the final response finishes generating, review that shutdown boundary when adopting v2.46.0. For normal completion of a final spoken reply, use playback completion as the point that permits closure.
The concrete change is in the Pydantic AI v2.46.0 release notes: “Add RealtimeSession.wait_for_playback() and let the docs examples finish the reply before closing,” in the feature entry for PR #8141. That supports a focused lifecycle change. It does not establish a latency improvement or an audio-quality result.
The integration decision is where your application declares the conversation finished. My recommendation is to keep response generation completion and playback completion distinct in the normal shutdown path. Review the examples for your installed version to place wait_for_playback() before session closure. The release note alone does not supply enough detail for a reliable copy-and-paste calling sequence.
Before adopting that path, validate three cases separately:
| Case | What to check in your application |
|---|---|
| Final reply completes normally | Record generation completion, the playback wait’s outcome, and session closure. Check that normal closure follows successful playback completion. |
| User interrupts the final reply | Decide whether interruption cancels the planned close or ends the interaction. Verify that the application follows that policy, and record how the playback wait exits. |
| Connection drops during the wait | Record the disconnect and wait outcome separately from successful completion. Verify that cleanup follows a defined failure path. |
These are proposed tests, not reported behavior of the new method. In particular, interruption and disconnect should not inherit a “reply finished” label merely because the session ended. Choose an application policy for a wait that does not complete normally, including how cleanup will happen, then verify the actual API behavior before implementing it.
There is also a limit to what “playback finished” can mean based on this announcement. The release notes do not define the completion signal, which client audio buffers it covers, or timeout and cancellation semantics. They do not guarantee that the listener physically heard every word. If your acceptance criterion is audible completion on a particular client, include a client-side playback check instead of treating a server-side event log as sufficient proof.
The useful migration question is concrete: does the final-reply close path wait for playback, and can your logs distinguish that successful path from interruption or disconnection? The release gives you a new method and an example change to investigate; those separate outcomes are the application checks to bring to the upgrade.