Skip to content

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

@YizukiAme

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

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