v1.86.1

pydantic/pydantic-aiv1.86.1Apr 24, 2026by DouweM

AI Summary

Fixes OpenAI streaming chunks, Anthropic container ID handling, tool-call retries validation, and warns about dict fields in Anthropic strict mode.

Key Highlights

  • Fix OpenAI guard against `choices=None` in streamed chunks
  • Fix Anthropic send `container_id` as string on reuse
  • Fix preserve validation error `input` on tool-call retries
  • Warn about `dict` fields with Anthropic strict mode

New Features

  • GPT-5.5 thinking setting support

Full Release Notes

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

## What's Changed
### 🐛 Bug Fixes
* fix(openai): guard against `choices=None` in streamed chunks (#5165) by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5170
* fix(anthropic): send `container_id` as string on reuse; unwrap broken {id: x} shape by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5168
* fix: preserve validation error `input` on tool-call retries by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5181
* fix(toolsets): prevent `MCPServer.__aexit__` called more times than `__aenter__` in `DynamicToolset` by @anishesg in https://github.com/pydantic/pydantic-ai/pull/5171
* Warn about `dict` fields with Anthropic strict mode  by @rahulmansharamani14 in https://github.com/pydantic/pydantic-ai/pull/4321
* Set `gen_ai.operation.name=execute_tool` on tool-execution spans by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5182
* fix: avoid stale client references in model and embedding classes by @Deeven-Seru in https://github.com/pydantic/pydantic-ai/pull/4276

## New Contributors
* @anishesg made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5171
* @rahulmansharamani14 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4321
* @Deeven-Seru made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4276

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v1.86.0...v1.86.1