Skip to content

Migrate anthropic provider to anthropic SDK 1.0 (httpx2) and remove the <1.0.0 cap #72071

Description

@o-nikolas

Workaround being applied

The anthropic provider is getting a temporary upper bound anthropic>=0.121.0,<1.0.0 (main dependency and the bedrock/vertex/aws extras).

Why

anthropic 1.0.0 (released 2026-08-20) replaces httpx with httpx2 (pydantic's fork). Once the automated CI environment upgrade bumped uv.lock to anthropic==1.0.0 (#72016, commit b5ab83f), "MyPy providers checks" started failing on every PR built on top of it:

providers/anthropic/tests/unit/anthropic/hooks/test_anthropic.py:287: error:
Argument "response" to "BadRequestError" has incompatible type
"httpx._models.Response"; expected "httpx2._models.Response"

This blocks unrelated PRs (first seen on the provider release PR #72069). Beyond the type error, 1.0 is a major SDK release and the provider has not been validated against it, so a cap is safer than a spot-fix of the test.

Follow-up work

  • Review the anthropic SDK 1.0 changelog / breaking changes and validate the provider (hooks, operators, triggers, sensors) against it.
  • Switch the test helpers that construct httpx.Request/httpx.Response to httpx2 equivalents.
  • Bump the minimum to a 1.x floor if the migration requires it, or keep dual compatibility if feasible.
  • Remove the <1.0.0 cap from providers/anthropic/pyproject.toml (main dependency and extras) and regenerate uv.lock.

Acceptance criteria for removing the cap

  • uv.lock resolves anthropic to a 1.x version.
  • MyPy providers checks and the anthropic provider unit tests pass against anthropic 1.x.

Drafted-by: Kiro CLI (claude-fable-5) (no human review 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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions