Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AttributeError: 'coroutine' object has no attribute 'text' when remote agent returns an Artifact (ADK A2A conversion failure) #1874

@snbaker

Description

@snbaker

When a remote agent invokes a tool that returns an Artifact, ADK fails while converting the response into A2A events.

2025-07-10 06:40:55,867 ERROR event_converter.py:600  Failed to convert event to A2A events: Artifact conversion failed: 'coroutine' object has no attribute 'text'
2025-07-10 06:40:55,867 ERROR a2a_agent_executor.py:149 Error handling A2A request: Artifact conversion failed: 'coroutine' object has no attribute 'text'

Traceback (most recent call last):
  File ".../google/adk/a2a/converters/event_converter.py", line 186, in _convert_artifact_to_a2a_events
    converted_part = convert_genai_part_to_a2a_part(part=artifact_part)
  File ".../google/adk/utils/feature_decorator.py", line 111, in wrapper
    return obj(*args, **kwargs)
  File ".../google/adk/a2a/converters/part_converter.py", line 149, in convert_genai_part_to_a2a_part
    if part.text:                    # <-- crashes here
AttributeError: 'coroutine' object has no attribute 'text'

The issue is in the A2A converter where it's trying to access .text on a coroutine object instead of awaiting it first.

Steps to Reproduce

Invoke a remote agent that calls a tool creating an Artifact (e.g., a file or image).

Invoke the agent through ADK’s new RemoteA2AAgent class.

Observe the conversion failure in logs; no response is returned to the caller.

Expected Behavior

The Artifact should be converted into one or more valid A2A Part objects (e.g., file, image, or blob), and the agent response should propagate without error.

Actual Behavior

The conversion code receives a coroutine, attempts to read part.text, and raises AttributeError, causing the entire A2A request to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bot triaged[Bot] This issue is triaged by ADK botcore[Component] This issue is related to the core interface and implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions