-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Please make sure you read the contribution guide and file the issues in the right place.
Contribution guide.
Describe the bug
The convert_a2a_part_to_genai_part function ignores metadata when converting A2A parts back to GenAI parts. This causes the thought field to be lost during A2A communication between agents, breaking remote multi-agent scenarios where reasoning/thought content needs to be preserved.
To Reproduce
from google.genai import types as genai_types
from google.adk.a2a.converters.part_converter import (
convert_genai_part_to_a2a_part,
convert_a2a_part_to_genai_part,
)
# Create part with thought=True
original = genai_types.Part(text="thinking...", thought=True)
# Round trip conversion
a2a_part = convert_genai_part_to_a2a_part(original)
result = convert_a2a_part_to_genai_part(a2a_part)
# Bug: thought is lost
print(f"Original thought: {original.thought}") # True
print(f"Result thought: {result.thought}") # None (should be True)Steps to reproduce:
- Install
google-adk - Run the code above
- Observe that
result.thoughtisNoneinstead ofTrue
Expected behavior
When a GenAI Part with thought=True is converted to A2A and back to GenAI, the thought field should be preserved. The round-trip should be lossless for metadata like thought.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS / Linux / Windows (all affected)
- Python version: 3.11+
- ADK version: Current main branch
Model Information:
- Are you using LiteLLM: N/A (bug is in part conversion, not model interaction)
- Which model is being used: N/A
Additional context
This issue affects any multi-agent A2A scenario where:
- A sub-agent generates content with
thought=True(e.g., reasoning steps) - The content is sent to a parent agent via A2A protocol
- The parent agent receives the content but loses the
thoughtmarker
This makes it impossible for downstream consumers (like UIs) to distinguish thoughts from regular content.