Bug Description
In src/google/adk/a2a/converters/event_converter.py, the _create_error_status_event function creates a TaskStatusUpdateEvent with final=False when the task has failed:
# event_converter.py line ~464
return TaskStatusUpdateEvent(
task_id=task_id,
context_id=context_id,
metadata=event_metadata,
status=TaskStatus(
state=TaskState.failed,
...
),
final=False, # <-- BUG: should be True for failed state
)
Expected Behavior
When a task has TaskState.failed, the TaskStatusUpdateEvent should have final=True, because error events represent terminal states — no further events will follow.
The existing implementation in from_adk_event.py already handles this correctly:
# from_adk_event.py line ~154
error_event = TaskStatusUpdateEvent(
...
final=True, # <-- correct
)
Actual Behavior
Clients/consumers that check the final flag will not know that processing has stopped after a failed status, potentially waiting indefinitely for more events or mishandling the error state.
Fix
Change final=False to final=True in _create_error_status_event in event_converter.py.
Signed-off-by: Cocoon-Break 54054995+kuishou68@users.noreply.github.com
Bug Description
In
src/google/adk/a2a/converters/event_converter.py, the_create_error_status_eventfunction creates aTaskStatusUpdateEventwithfinal=Falsewhen the task has failed:Expected Behavior
When a task has
TaskState.failed, theTaskStatusUpdateEventshould havefinal=True, because error events represent terminal states — no further events will follow.The existing implementation in
from_adk_event.pyalready handles this correctly:Actual Behavior
Clients/consumers that check the
finalflag will not know that processing has stopped after afailedstatus, potentially waiting indefinitely for more events or mishandling the error state.Fix
Change
final=Falsetofinal=Truein_create_error_status_eventinevent_converter.py.Signed-off-by: Cocoon-Break 54054995+kuishou68@users.noreply.github.com