Repository navigation
Description
Describe the bug
With the new A2A executor (A2aAgentExecutor(force_new_version=True), or any client that requests the ADK A2A extension), an ADK event that carries only actions (for example the state change from a before_agent_callback) is converted into a TASK_STATE_WORKING status update whose status.message has an empty parts list. The a2a-sdk task manager then appends that message to task.history, so GetTask and the SendMessage response return an agent message with no parts.
A2A v1.0 marks Message.parts as REQUIRED, and §5.7 says: "Arrays marked as required MUST contain at least one element." The legacy executor does not produce this message for the same agent.
The block is in convert_event_to_a2a_events in src/google/adk/a2a/converters/from_adk_event.py (main 4e3aff7, around L205–L220): when an event has no content parts but has actions, it builds Message(..., parts=[]) to carry the actions metadata.
To Reproduce
google-adk 2.15.1 (main 4e3aff7), a2a-sdk 1.3.1:
from google.adk.a2a.executor.a2a_agent_executor import A2aAgentExecutor
from google.adk.a2a.utils.agent_to_a2a import to_a2a
from google.adk.agents import BaseAgent
from google.adk.events import Event
from google.genai import types
class EchoAgent(BaseAgent):
async def _run_async_impl(self, ctx):
text = ctx.user_content.parts[0].text
yield Event(author=self.name, invocation_id=ctx.invocation_id,
content=types.Content(role='model', parts=[types.Part(text=f'echo: {text}')]))
def remember_turn(callback_context):
callback_context.state['turns'] = callback_context.state.get('turns', 0) + 1
app = to_a2a(
EchoAgent(name='echo_agent', before_agent_callback=remember_turn),
host='127.0.0.1', port=10404,
agent_executor_factory=lambda r: A2aAgentExecutor(runner=r, force_new_version=True),
)Run it with uvicorn, then send {"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{"message":{"messageId":"m1","role":"ROLE_USER","parts":[{"text":"hi"}]}}}.
result.task.history is:
[
{"messageId": "m1", "role": "ROLE_USER", "parts": [{"text": "hi"}], ...},
{"messageId": "...", "role": "ROLE_AGENT", "metadata": {"adk_actions": {"stateDelta": {"turns": 1.0}}, ...}}
]The second message has no parts. With SendStreamingMessage, the same message appears as the status.message of a TASK_STATE_WORKING status update. Without force_new_version (legacy executor), the history holds the agent's echo: hi reply instead.
Expected behavior
No agent message with empty parts in status updates or in task history. The actions could travel in the status update event's own metadata (or the event could be skipped when there is nothing else to send), but that depends on how RemoteA2aAgent reads them back, so I've left the choice open.
Additional context
Found while running the A2A conformance suites (a2a-tck and the a2a-itk ACTS corpus) against to_a2a(). Neither suite checks history messages for empty parts today. I'm happy to open a PR once the preferred shape is clear.
Activity
KilianTheMagnificent commentedon Nov 26, 2026
Independent confirmation, plus two details that may help pick the fix shape.
Reproduced offline on published
google-adk 2.15.1and onmainat9fd6b33(a2a-sdk 1.3.1, Python 3.12.13, macOS arm64), using the reporter's app under localuvicornon127.0.0.1, with theA2A-Version: 1.0header. Line numbers below are formainat9fd6b33; 2.15.1 has the same code 2–3 lines lower.SendMessageandGetTask:task.history[1]isROLE_AGENTwith nopartsandmetadata.adk_actions = {"stateDelta": {"turns": 1.0}}.SendStreamingMessage:taskSUBMITTED →statusUpdateWORKING →statusUpdateWORKING with that same parts-less agent message →artifactUpdate(echo: hi) →statusUpdateCOMPLETED.force_new_version=False:history[1]is theecho: hiagent message; no parts-less message anywhere.1. It isn't limited to state changes. The guard at
from_adk_event.pyL205,elif _serialize_value(event.actions) is not None:, is always true for an event with no content parts:_serialize_value(EventActions())returns{'stateDelta': {}}, notNone. So these all produce the parts-less message (checked throughconvert_event_to_a2a_events): state-only, artifact_delta-only, escalate-only, transfer-only, skip_summarization-only, requested-auth-only, usage-metadata-only, content withparts=[], and even anEventwith no content and no actions (live, that last one lands intask.historyas a message withadk_actions: {"stateDelta": {}}). TheMessage(..., parts=[])at L206–209 is the only parts-lessMessageconstruction ina2a/; the other agent messages (error, long-running, legacyevent_converter) always carry parts or returnNone.2. What the ADK reader does with that message.
convert_a2a_status_update_to_eventreads actions fromstatus.message.metadata(to_adk_event.pyL726), which is whatRemoteA2aAgent's new-path handler calls, but honors onlyescalateandskip_summarization(_PEER_SETTABLE_ACTION_FIELDS, L317). In a round trip, escalate-only and skip_summarization-only come back as events with those flags. State-only, artifact_delta-only, transfer-only, auth-only and empty events come back as no event at all, loggingIgnoring a session state delta from a remote A2A peer(for a state delta) andNo parts could be converted from A2A message. So for those shapes the message carries nothing an ADK client uses, and for the other two moving the actions to the update's ownmetadatawould need a matching change in the reader.Disclosure: an AI agent (Claude) ran these checks and drafted this comment on my behalf, and a second, independent AI pass re-ran them before posting. Every output quoted above comes from a real local run. Scripts and full output available on request.
08raviyadav commentedon Nov 26, 2026
Hi, I reproduced this and would like to fix it. Proposed shape (matching the legacy executor, which emits nothing for content-less events):
escalateorskip_summarization(the only actions the reader rebuilds from peer metadata) emits a message-lessWORKINGTaskStatusUpdateEvent, with the full event metadata on the update's ownmetadatafield. The reader falls back to the update's metadata when there is no status message, so the flags survive the round trip. NoMessagewith emptypartsis ever built.DataPart.Two things I want to flag rather than guess: usage-metadata-only events are skipped like legacy, so usage info for content-less events is dropped on the wire; and I'm leaving
convert_a2a_task_to_event(task-level) untouched. If that shape sounds right, I'll open a PR with the fix and regression tests (including a round-trip test).