Skip to content

bug: error TaskStatusUpdateEvent has final=False in event_converter.py #5388

@kuishou68

Description

@kuishou68

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

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementation

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions