Skip to content

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

Closed

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

Activity

  1. added theissue type on Apr 19, 2026
  2. added a commit that references this issue on Apr 19, 2026
    8850645
  3. added
    core[Component] This issue is related to the core interface and implementation
    on Apr 19, 2026
  4. kuishou68 commented on Apr 19, 2026

    @kuishou68
    Author

    Fix submitted in PR #5389: #5389

  5. surajksharma07 commented on Jun 5, 2026

    @surajksharma07
    Collaborator

    /adk-issue-analyze

  6. surajksharma07 commented on Jun 9, 2026

    @surajksharma07
    Collaborator

    /adk-issue-analyze

  7. added a commit that references this issue on Jun 12, 2026
    5efe53d
  8. added a commit that references this issue on Aug 11, 2026
    9482f34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions