Skip to content

fix(deps): bump anthropic to 1.0.0, migrate Bedrock judge path to httpx2 - #133

Merged
akshaylive merged 4 commits into
mainfrom
akshaya/anthropic_upgrade
Aug 21, 2026
Merged

fix(deps): bump anthropic to 1.0.0, migrate Bedrock judge path to httpx2#133
akshaylive merged 4 commits into
mainfrom
akshaya/anthropic_upgrade

Conversation

@akshaylive

Copy link
Copy Markdown
Collaborator

Summary

  • Bump anthropic to >=1.0.0,<2.0.0 (was >=0.86.0); anthropic 1.0.0 migrated its HTTP layer from httpx to httpx2, so its exceptions (e.g. APIConnectionError) now carry an httpx2.Request.
  • Declare httpx2>=2.12.0 explicitly in pyproject.toml since judge_bedrock.py constructs it directly (previously only pulled in transitively).
  • Migrate judge_bedrock.py's Bedrock invoker off the classic httpx package onto httpx2 for consistency with the new anthropic SDK, updating test_judge_bedrock.py, test_judge_anthropic.py, and doc references accordingly.
  • Relocked uv.lock.

Test plan

  • make test (full suite): 4690 passed, 8 skipped (missing API keys/docker), 3 pre-existing environment-only failures unrelated to this change (Docker daemon unavailable; live Codex/Claude Code agent network tests)
  • ruff check + pyright clean on all touched files

🤖 Generated with Claude Code

…httpx2

anthropic>=1.0.0 migrated its HTTP layer from httpx to httpx2, so its
exceptions (e.g. APIConnectionError) now carry an httpx2.Request. Pin
anthropic>=1.0.0,<2.0.0, declare httpx2 explicitly since judge_bedrock.py
uses it directly, and swap judge_bedrock.py's Bedrock invoker (plus its
tests) from httpx to httpx2 for consistency across the judge paths.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
uipreliga

This comment was marked as outdated.

@uipreliga uipreliga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix what you agree with and 🚢

…re kwarg

anthropic 1.0.0 removed temperature/top_p/top_k as top-level
AsyncMessages.create kwargs, so the Direct-backend llm_judge path raised an
uncaught TypeError on every call and silently scored rows 0.0 (TypeError
isn't in _ESCALATING_EXCEPTIONS). Forward temperature via extra_body instead
(the raw Messages API body still accepts it, same as the Bedrock path), and
escalate any unexpected exception from the SDK call as JudgeInfrastructureError
so a future signature break fails loudly instead of scoring the agent down.

Also: rebuild the test double as a signature-bound mock so a removed/renamed
SDK kwarg fails the unit test instead of passing against a bare MagicMock;
replace the blanket `# type: ignore[arg-type]` with the rule-scoped
`# pyright: ignore[reportArgumentType]`; cap httpx2<3.0.0 to mirror
anthropic's own bound on it; and drop the two `import httpx2 as _httpx`
aliases in test_judge_bedrock.py that made the new library read as the old
one in the PR that migrates off it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@UiPath UiPath deleted a comment from github-actions Bot Aug 21, 2026
akshaylive and others added 2 commits August 21, 2026 08:18
pip-audit flagged pip 26.1.2 (PYSEC-2026-3721: doubly-encoded package URLs
from a malicious index could write installed files outside the target dir).
`--upgrade pip` alone depends on PyPI's latest at run time; pin an explicit
>=26.2 floor so every job's bootstrap reliably lands on the fixed version.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The prior CI-workflow fix bumped the wrong pip: pr-checks.yml's
`python -m pip install --upgrade pip` only touches the throwaway system
Python used to bootstrap `uv` itself. The pip pip-audit actually flagged
lives inside .venv, resolved from uv.lock via the transitive
pip-audit -> pip-api -> pip chain, uncapped at 26.1.2. Re-lock so
`uv sync --frozen` (what CI runs) lands on the fixed 26.2.1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@akshaylive
akshaylive merged commit beecedd into main Aug 21, 2026
15 checks passed
@akshaylive
akshaylive deleted the akshaya/anthropic_upgrade branch August 21, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants