v2.13.0

bevyengine/bevyv2.13.0Jul 18, 2026by dsfaccini

AI Summary

Focusing on instrumentation and observability, this release adds usage tracking metrics like cache hit ratios and introduces hooks for model resolution.

Key Highlights

  • Added `include_model_request_parameters` instrumentation setting
  • Added `cache_hit_ratio` property to `RequestUsage` and `RunUsage`
  • Added `get_model`, `resolve_model_id`, and `for_agent` capability hooks
  • Fixed `MistralModel` streaming settings
  • Fixed spurious OTel `Failed to detach context` error during streaming

New Features

  • `include_model_request_parameters` instrumentation setting
  • `cache_hit_ratio` property
  • Model resolution hooks

Full Release Notes

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

## What's Changed
### 🚀 Features
* Add `include_model_request_parameters` instrumentation setting to omit the `model_request_parameters` span attribute by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6488
* Add `RaiseContentFilterError` capability to raise content filter error for non-empty content filter responses by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6167
* feat(usage): add `cache_hit_ratio` property to `RequestUsage` and `RunUsage` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6529
* Add `get_model`, `resolve_model_id`, and `for_agent` capability hooks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6333
### 🐛 Bug Fixes
* Fix `MistralModel` streaming settings by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6563
* Close open message parts (text, thinking, tool calls) on UI stream error by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6550
* Fix spurious OTel `Failed to detach context` error when a streamed run is interrupted mid-segment by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6572
* fix(temporal): pass through `pydantic_monty` in workflow sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6564
### 📦 Dependencies
* deps: bump `mcp` to 1.28.1 for Dependabot alerts by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6562


**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.12.0...v2.13.0