Skip to content

RemoteA2aAgent handlers crash on None converter results (AttributeError) #5187

Closed

Description

@YizukiAme

Bug Description

In remote_a2a_agent.py, both _handle_a2a_response() (legacy) and _handle_a2a_response_v2() access attributes like event.content or event.custom_metadata on results from convert_a2a_message_to_event() / convert_a2a_task_to_event() without checking for None. This results in AttributeError when a converter legitimately returns None.

Additionally, the legacy handler still uses the outdated event_converter.py path instead of the newer to_adk_event.py converters, and update.context_id is ignored in favor of task.context_id only.

Steps to Reproduce

This can be triggered when a remote A2A agent sends:

  • A message with no convertible parts
  • A task snapshot with no artifacts and no status message
  • A status update where the message converter returns None

Expected Behavior

Handlers should guard against None converter results with early returns.

Affected Files

  • src/google/adk/agents/remote_a2a_agent.py

Activity

  1. enjoykumawat commented on Apr 7, 2026

    @enjoykumawat
    Contributor

    I'd like to work on this. The fix is a None-check on converter results before accessing attributes. Will submit a PR shortly.

  2. added theissue type on Apr 8, 2026
  3. added
    core[Component] This issue is related to the core interface and implementation
    on Apr 8, 2026
  4. added 2 commits that reference this issue on Apr 9, 2026
    285dbb3
    22df0cc
  5. sanketpatil06 commented on Apr 14, 2026

    @sanketpatil06

    Hello @YizukiAme,
    Thank you for reporting this issue and providing the details. I was able to reproduce it on my end.

    The AttributeError occurs because the asynchronous _handle_a2a_response method tries to access attributes of an empty event. This happens when the internal converter processes A2A status updates that are empty or contain only metadata.

    Pull Requests #5199 and #5219 have already been opened to address this, and our team is currently reviewing them.

    We truly appreciate your contributions!

  6. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on May 6, 2026
  7. added a commit that references this issue on Jun 17, 2026
    23ff66e
  8. added a commit that references this issue on Jun 25, 2026
    2e3d717
  9. added 2 commits that reference this issue on Aug 11, 2026
    191ce1d
    9451dc1
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 implementationneeds review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions