Skip to content

5.22.0 — 2026-10-27

← 5.23.0 | 5.21.2 → | ↑ 5.x series

Added

Helpers - Pydantic AI Instrumentation

  • Pydantic AI Auto-Instrumentation - Pydantic AI agents now export their traces and metrics through ArchiPy's OpenTelemetry providers.
    • OtelUtils initialization calls Agent.instrument_all with ArchiPy's tracer and meter providers when pydantic-ai-slim is installed
    • Agent runs (invoke_agent <name>), model requests (chat <model>) and tool calls (execute_tool <name>) become spans, and token usage becomes the gen_ai.client.token.usage metric
    • Delegated agents are traced under the calling tool, and agents run inside FastAPI or gRPC requests join the request trace
    • Settings an application installed itself with Agent.instrument_all are left alone
    • In Elastic APM an agent run inside a request is a span of the request transaction; an agent run outside a request is a root span, which APM types as unknown

Configs - Pydantic AI

  • PydanticAIConfig - Added the BaseConfig.PYDANTIC_AI section that controls the instrumentation.
    • INSTRUMENTATION_ENABLED (default true) turns the instrumentation off
    • INSTRUMENTATION_INCLUDE_CONTENT (default true) keeps prompts, model output and tool arguments and results in span attributes; turn it off when they hold personal or secret data
    • INSTRUMENTATION_INCLUDE_BINARY_CONTENT (default false) keeps images, audio and documents in span attributes
    • INSTRUMENTATION_INCLUDE_MODEL_REQUEST_PARAMETERS (default true), INSTRUMENTATION_VERSION (default 6, or 5) and INSTRUMENTATION_USE_AGGREGATED_USAGE_ATTRIBUTE_NAMES (default true) map to the matching InstrumentationSettings options

Tests

Tests - Pydantic AI

  • Pydantic AI Telemetry Scenarios - Added features/pydantic_ai_otel.feature with 22 scenarios against the real OpenTelemetry Collector and Elastic APM Server containers.
    • Agent, model request and tool spans, the token usage metric, delegated, concurrent and sequential agents, and agents inside FastAPI and gRPC requests
    • The configuration switches, and Elastic APM Server both directly and through the collector
    • Added the feature to the telemetry CI group

Tests - Elastic APM

  • APM Scenarios in Separate Features - Moved the Elastic APM scenarios of every adapter into their own <feature>_apm.feature files (Elasticsearch, email, Kafka, Keycloak, MinIO, Redis, ScyllaDB, Temporal, Vault and the SQL atomic transactions), so a feature that does not need the telemetry stack no longer starts it.
  • APM Search Helper - The Elastic APM test container treats a 503 from the search as "no events yet" and skips stored documents that carry no processor field, instead of failing on them.

Tests - Keycloak

  • Keycloak Feature Split - Split the Keycloak adapter and auth guard scenarios into smaller features (authentication flows and mappers, clients and tokens, management, tokens and organizations, FastAPI guards, gRPC guards, cache and Envoy guards) so each runs in its own CI group.
  • Split Hostnames and Envoy - The Keycloak tests run with split hostnames and through Envoy.
  • Test Fixes - Whole hosts are compared in the client node step, the audience is built from the realm issuer, the container probe keeps going while the health endpoint answers an HTTP error, and the adapter steps import KeycloakConfig.

Tests - SQLAlchemy

  • Atomic Transactions Per Database - Split features/atomic_transactions.feature into one feature per database (PostgreSQL, MySQL, SQLite and StarRocks), each with an APM feature of its own, and moved Kafka client span scenarios into features/kafka_clients_spans.feature.

Chore

Chore - CI

  • Behave Matrix - Reworked how CI runs the Behave features.
    • Features run in descriptive, parallel groups per package, ordered slowest first, and only the groups a pull request can affect run (selected with dorny/paths-filter)
    • The core group runs every feature no other group lists, so a new feature file needs no workflow edit
    • Superseded runs are cancelled, and jobs install the locked dependencies with only the extras they need
    • make behave and scripts/behave_parallel.py take EXCLUDE / --exclude to leave features out of a run
  • New Workflows - Added a labeler that labels pull requests by the paths they change, a dependency review, a link check for the docs and README, and a workflow that comments on the issue a merged pull request names.
  • Removed Workflows - Removed the Bandit workflow. A CodeQL workflow was added and dropped again because the repository uses the default setup.

Chore - Repository

  • Issue Forms - Replaced the Markdown issue templates with forms (bug report, feature request, documentation improvement, question), added the issue template config and tailored the pull request template.

Chore - Docs

  • README and Docs Links - Updated the README badges and the CI badge in docs/index.md, and fixed the dead links the link check found.
  • Contributor Rules - Added a repository map, don'ts and a definition of done to AGENTS.md, and documented in the Cursor rules the findings workflow (issue, fix, pull request, merge), labels, the Behave CI groups, small pull requests and keeping the issue checklist up to date.

Chore - Test Images

  • Test Container Images - Updated the StarRocks image from 4.1.6 to 4.1.7 and added ENVOY__IMAGE=envoyproxy/envoy:v1.40.1 to .env.test; MySQL stays on the 8.4 LTS line.

Dependencies

Dependencies - Extras

  • pydantic-ai and otel-pydantic-ai Extras - Added archipy[pydantic-ai] (pydantic-ai-slim>=2.62.0) and archipy[otel-pydantic-ai], which also installs archipy[otel].

Dependencies - Lower Bounds

  • Lower Bounds Match uv.lock - Raised the lower bounds to the locked versions.
    • cachetools>=7.2.6, grpcio>=1.85.0 and grpcio-health-checking>=1.85.0
    • Development tools boto3-stubs>=1.43.119, ruff>=0.17.3 and ty>=0.0.92