Repository navigation
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.
Activity
surajksharma07 commentedon Jan 30, 2026
@filipecaixeta the bug is in
part_converter.py:63-64whereconvert_a2a_part_to_genai_partreturnsgenai_types.Part(text=part.text)without reading back thethoughtmetadata that was stored during the forward conversion at line 163.Your PR #4241 looks like the right fix.
As a workaround until it's merged, you can monkey-patch
convert_a2a_part_to_genai_partto readpart.metadata.get(_get_adk_metadata_key('thought'))and pass it to the Part constructor.Team is looking more into it.
filipecaixeta commentedon Feb 24, 2026
@surajksharma07 I've been waiting for over a month for this.
surajksharma07 commentedon Feb 25, 2026
@seanzhou1023 Please have a look into it.
surajksharma07 commentedon Feb 25, 2026
@filipecaixeta Apologies for the delay — your PR #4241 has been escalated for review and assigned to a team member.
sasha-gitg commentedon Mar 2, 2026
This seems to be resolved: e59929e1