You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Add validation for empty artifact lists in completed_task (#308)
This update addresses an issue where the `completed_task` function in
`a2a/utils/task.py` did not perform any validation on the `artifacts`
list. This could lead to unexpected behavior if an empty or invalid list
was provided.
This change introduces a validation check to ensure that the `artifacts`
list is a non-empty list of `Artifact` objects, raising a `ValueError`
if the validation fails.
**Changes:**
- Modified `a2a/utils/task.py` to add a validation check for the
`artifacts` parameter in the `completed_task` function.
- Updated `tests/utils/test_task.py` to include tests for the new
validation logic, covering cases with empty lists and lists containing
invalid items.
0 commit comments