Pydantic AI 2.40 adds realtime interruption, event hooks and safer recovery
Pydantic AI released 2.40 with realtime barge-in and played-audio tracking, out-of-band prompt enqueueing, agent event listeners and background price refresh. It also fixes parallel tool-result grouping, invalid-audio rollback, tool-failure stream shutdown and a realtime cancellation race.
Why it matters: Voice and realtime agents need to interrupt, account for what a user actually heard and recover without corrupting session state. The new controls make those transitions observable and programmable instead of leaving them as transport-specific edge cases.