v2.37.0

pydantic/pydantic-aiv2.37.0Sep 1, 2026by dsfaccini

AI Summary

This release introduces support for the new `glm-5.3-flash` model and improves the stability of Z.AI integrations. It includes several bug fixes related to span queries, finish reasons, and GoogleModel routing, alongside improvements to durable operations and tool discovery for Prefect.

Key Highlights

  • Added support for the new `glm-5.3-flash` model
  • Reworked Z.AI test suite onto cassettes
  • Fixed preservation of conditions in pruned span queries
  • Updated `GoogleModel` to route Vertex-vs-Gemini API branches via client transport
  • Improved context management for models in durable operations

New Features

  • Support for `glm-5.3-flash` model
  • Reworked Z.AI test suite onto cassettes
  • Emit AG-UI `TEXT_MESSAGE_START` for assistant messages with tool calls

Full Release Notes

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed
### 🚀 Features
* Add `glm-5.3-flash` and rework the Z.AI test suite onto cassettes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7887
### 🐛 Bug Fixes
* fix: preserve all conditions in pruned span queries by @mikemikimike in https://github.com/pydantic/pydantic-ai/pull/7499
* Accept and map Z.AI's non-standard `finish_reason` values by @zhj12395 in https://github.com/pydantic/pydantic-ai/pull/7685
* Emit an AG-UI `TEXT_MESSAGE_START` for the assistant message that owns a response's tool calls by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7699
* Route Vertex-vs-Gemini API branches in `GoogleModel` by client transport instead of provider name by @thejamesgore in https://github.com/pydantic/pydantic-ai/pull/7280
* Skip inactive capability hooks in agent tracebacks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7328
* Context-manage models rebuilt inside durable operations by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/7954
* Reject per-run `capabilities=` on DBOS, matching Temporal by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6955
* Journal Prefect tool discovery in tasks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6966
* Stop rebuilding unmanaged models in durable capability operations by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7972

## New Contributors
* @zhj12395 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/7685
* @thejamesgore made their first contribution in https://github.com/pydantic/pydantic-ai/pull/7280
* @pcbeingused333 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/7936
* @quinnarnold made their first contribution in https://github.com/pydantic/pydantic-ai/pull/7921

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.36.0...v2.37.0