Daily News · 1 min read

Pydantic AI Updates: September 3, 2026

1. Pydantic AI v2.38.0 Adds Context Window Tracking and Typed Custom Events

Pydantic AI. The release adds context_window to ModelProfile and context_window_used to RunContext, so agent code can read how much of the window a run has consumed rather than estimating it. Application code and capabilities can now emit typed CustomEvents and CapabilityEvents into the run event stream and subscribe with @on_event. Model coverage expands with gemini-3.8-flash, Claude Fable 5.1, and Claude Mythos 5.1, and a new profile flag rejects streams that arrive without a finish_reason. Fixes include keeping a run cancelled during its first tool call resumable, preventing synthetic reasoning IDs from reaching OpenAI Responses, and correcting CodeExecutionTool uploads that never reached a fresh Anthropic container on multi-turn histories. Source