fix(deps): bump anthropic to 1.0.0, migrate Bedrock judge path to httpx2 - #133
Merged
Conversation
…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>
akshaylive
requested review from
bai-uipath,
tmatup and
uipreliga
as code owners
August 21, 2026 07:00
uipreliga
approved these changes
Aug 21, 2026
uipreliga
left a comment
Collaborator
There was a problem hiding this comment.
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
anthropicto>=1.0.0,<2.0.0(was>=0.86.0); anthropic 1.0.0 migrated its HTTP layer fromhttpxtohttpx2, so its exceptions (e.g.APIConnectionError) now carry anhttpx2.Request.httpx2>=2.12.0explicitly inpyproject.tomlsincejudge_bedrock.pyconstructs it directly (previously only pulled in transitively).judge_bedrock.py's Bedrock invoker off the classichttpxpackage ontohttpx2for consistency with the new anthropic SDK, updatingtest_judge_bedrock.py,test_judge_anthropic.py, and doc references accordingly.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+pyrightclean on all touched files🤖 Generated with Claude Code