Visitar URL original
fix(eval): retry judge timeouts with the request options by claxman · Pull Request #8121 · google/adk-python · GitHub
Skip to content

fix(eval): retry judge timeouts with the request options - #8121

Open
claxman wants to merge 2 commits into
google:mainfrom
claxman:fix/8075-eval-judge-timeout
Open

claxman wants to merge 2 commits into
google:mainfrom
claxman:fix/8075-eval-judge-timeout

Conversation

@claxman

@claxman claxman commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:
Eval judges attach HttpRetryOptions, but a client TimeoutError still fails the sample on the first try. TimeoutError is not in google-genai's aiohttp transient set, and a non-Gemini judge never reads the retry options. LlmAsJudge, HallucinationsV1Evaluator, and PerTurnUserSimulatorQualityV1 do not retry the timeout themselves, so one timed-out sample marks the invocation NOT_EVALUATED.

Solution:
read_judge_response_with_retry builds a tenacity AsyncRetrying from the request's HttpRetryOptions (attempts, backoff, jitter) and logs each retry. The three judges above call it. Other errors are not retried. When attempts are used up the sample stays not evaluated. User simulators are not in this change, and google-genai's transient list is not modified.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

test_read_judge_response_retries_a_timeout covers both timeout types. test_read_judge_response_stops_after_the_attempt_count stops at attempts=2. test_read_judge_response_does_not_retry_other_errors keeps a RuntimeError to one call. test_evaluate_invocations_retries_a_judge_timeout checks LlmAsJudge uses the helper.

pytest tests/unittests/evaluation/test_retry_options_utils.py tests/unittests/evaluation/test_llm_as_judge.py tests/unittests/evaluation/test_hallucinations_v1.py tests/unittests/evaluation/simulation/test_per_turn_user_simulation_quality_v1.py

106 passed. mypy on the four source files: no issues.

Manual End-to-End (E2E) Tests:

I did not run adk eval against a live model. The tests use a mocked judge.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

HttpRetryOptions were attached to judge requests and then ignored for
TimeoutError, so one client timeout marked the sample not evaluated.
The judge now retries that timeout, and an auth timeout, for the
configured number of attempts.

Fixes google#8075
LlmAsJudge, HallucinationsV1, and the per-turn quality judge attached
HttpRetryOptions and then failed the sample on the first TimeoutError.
They now share a tenacity retry that honors those options.

Fixes google#8075
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.

Eval LLM judges do not retry client-side TimeoutError / google.auth.exceptions.TimeoutError despite HttpRetryOptions

2 participants