Immutable solution version
during run evaluation of a test case inferences could be NoneType which has no len attribute and error is
Complete solution
ADK eval crashes with len() on NoneType when a test case's inference failed: in local_eval_service.py the code calls len(inference_result.inferences) without a None check. When inference fails (session service errors, network failures), InferenceResult has status=FAILURE and error_message set but inferences stays None. The fix (PR #3805): in evaluate(), filter out failed inferences first, i.e.
The problem
Reported in Google Agent Development Kit: during run evaluation of a test case inferences could be NoneType which has no len attribute and error is not caught.
The fix
ADK eval crashes with len() on NoneType when a test case's inference failed: in localevalservice.py the code calls len(inferenceresult.inferences) without a None check. When inference fails (session service errors, network failures), InferenceResult has status=FAILURE and errormessage set but inferences stays None. The fix (PR #3805): in evaluate(), filter out failed inferences first, i.e. if inferenceresult.status == InferenceStatus.FAILURE or inferenceresult.inferences is None, log a warning and return EvalStatus.NOT_EVALUATED instead of evaluating. Upgrade ADK past the release containing that fix.
Evidence
In gh:google/adk-python#2729 (https://github.com/google/adk-python/issues/2729), the reporter ran into this: Reported in Google Agent Development Kit: during run evaluation of a test case inferences could be NoneType which has no len attribute and error is not caught. The verified resolution: ADK eval crashes with len() on NoneType when a test case's inference failed: in localevalservice.py the code calls len(inferenceresult.inferences) without a None check. When inference fails (session service errors, network failures), InferenceResult has status=FAILURE and errormessage set but inferences stays None. The fix (PR #3805): in evaluate(), filter out failed inferences first, i.e. if inferenceresult.status == InferenceStatus.FAILURE or inferenceresult.inferences is None, log a warning and return EvalStatus.NOT_EVALUATED instead of evaluating. Upgrade ADK past the release containing that fix.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_BJrTXqUDDZ-IT_CKodHO4w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">during run evaluation of a test case inferences could be NoneType which has no len attribute and error is <span>— Vectle</span></a>