v1.80.0

pydantic/pydantic-aiv1.80.0Apr 10, 2026by DouweM

AI Summary

Introduces capability ordering and server-side compaction support for OpenAI and Anthropic models. This allows for more granular control over tool execution order and reduces context window usage.

Key Highlights

  • Add CapabilityOrdering (`innermost`, `outermost`, `wraps`, `wrapped_by`, `requires`)
  • Add server-side compaction support via OpenAICompaction and AnthropicCompaction
  • Reverse capability iteration for consistency with wrap_ hooks

New Features

  • CapabilityOrdering
  • Server-side compaction support

Full Release Notes

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

## What's Changed
### 🚀 Features
* Add `CapabilityOrdering` (`innermost`, `outermost`, `wraps`, wrapped_by`, `requires`) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5036
* `Hooks` ordering parameter and instance refs in `wraps`/`wrapped_by` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5048
* Add server-side compaction support via `OpenAICompaction` and `AnthropicCompaction` capabilities by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4943
### 🐛 Bug Fixes
* Reverse capability `get_wrapper_toolset` iteration for consistency with `wrap_` hooks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5036
* Remove warning suppression fixed by the bump to mistral version >= 2.0.0 by @DarthJuri in https://github.com/pydantic/pydantic-ai/pull/4629
* fix: make `mcp` optional for DBOS module import by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5050
* bug: Warn about Azure OpenAI completions file-incompatibility by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4048
* fix: unknown tool calls no longer exhaust global retry counter by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4940
* fix: output validators see global retry counter on tool output path by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4956


**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v1.79.0...v1.80.0