Skip to content

Migrate common.ai provider to pydantic-ai 2.x and remove the <2 cap #69122

Description

@potiuk

The "Upgrade important CI environment" automation (#68933) pulled pydantic-ai-slim from 1.107.0 to 2.0.0 (a major release). pydantic-ai 2.0 changed the agent instrumentation API, breaking providers/common/ai — test_pydantic_ai.py::...test_caller_instrument_short_circuits fails with TypeError: got an unexpected keyword argument 'instrument'.

To keep the CI-tooling upgrade unblocked, #68933 caps pydantic-ai-slim>=1.99.0,<2 in providers/common/ai/pyproject.toml.

Follow-up work: migrate the provider (PydanticAIHook.create_agent, observability/instrumentation, AgentOperator) to the pydantic-ai 2.x API, update the unit tests, then remove the <2 cap and re-lock.

Acceptance: cap removed; common.ai unit tests and mypy pass against pydantic-ai 2.x.


Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions