A streaming response could end before the model did.
Pydantic AI v1.92.0 could return an incomplete or empty agent response when a supplied stream handler returned early. Fourteen releases were affected before v1.106.0 restored the behavior.
The anatomy of a regression
- 01 Project
- 02 Regression & fix
- 03 Early replay
An open-source framework for production AI agents.
Pydantic AI is the Pydantic team's open-source Python framework for building production-grade AI agents with typed models, tools, and outputs.
Project repositoryAgent responses could be incomplete.
A cancellation cleanup removed the normal completion-path drain loop. If an event stream handler returned before consuming every event, remaining events were not drained into the final response. Tool calls could disappear and usage could read zero.
Model provider → event stream → event_stream_handler → ModelResponse- Compared
- v1.91.0 → v1.92.0
- Affected
- v1.92.0–v1.105.0 · 14 releases
- Public report
- User · 26 days after release
- Fixed
- v1.106.0 · 28 days later

Early found the regression.
“Removed forced drain truncates usage on early exit”
Early traced the incomplete response to the removed drain loop and proposed a focused verification. The reproduction passed on v1.91.0, failed on v1.92.0, and passed again on v1.106.0.
Follow the record.
Independent replay. Not affiliated with Pydantic.
Explore more Case Files