Commit 9a6cf60
fix(eval): handle failed inference results without invocations
Merge #5878
## What changed
- Return a failed `EvalCaseResult` when inference failed before producing any invocations.
- Preserve the existing session lookup path when a failed inference still has a session id.
- Add a regression test for `InferenceResult(status=FAILURE, inferences=None)`.
- Clean up two existing lint issues in the touched eval test file so the local changed-file ruff check passes.
This prevents the eval runner from replacing the original inference error with `TypeError: object of type 'NoneType' has no len()`.
Fixes #5876
## To verify
- `.\.venv\Scripts\python.exe -m py_compile src\google\adk\evaluation\local_eval_service.py tests\unittests\evaluation\test_local_eval_service.py`
- `.\.venv\Scripts\python.exe -m pytest tests\unittests\evaluation\test_local_eval_service.py -k "failed_without_inferences or evaluate_single_inference_result" -q --basetemp .tmp\pytest`
- `.\.venv\Scripts\python.exe -m ruff check src\google\adk\evaluation\local_eval_service.py tests\unittests\evaluation\test_local_eval_service.py`
- `.\.venv\Scripts\python.exe -m pyink --check src\google\adk\evaluation\local_eval_service.py tests\unittests\evaluation\test_local_eval_service.py`
- `git diff --check`
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=#5878 from he-yufeng:fix/eval-failed-inference-none 5ed777d
PiperOrigin-RevId: 9331762481 parent 4024467 commit 9a6cf60
2 files changed
Lines changed: 57 additions & 2 deletions
File tree
- src/google/adk/evaluation
- tests/unittests/evaluation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
280 | 303 | | |
281 | 304 | | |
282 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
465 | 464 | | |
466 | 465 | | |
467 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
468 | 500 | | |
469 | 501 | | |
470 | 502 | | |
| |||
520 | 552 | | |
521 | 553 | | |
522 | 554 | | |
523 | | - | |
| 555 | + | |
524 | 556 | | |
525 | 557 | | |
526 | 558 | | |
| |||
0 commit comments