A2A (new executor): a state-only event becomes a status update whose agent message has no parts, and it lands in task history
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend-api-design
Línea de trabajo
Start with convert_event_to_a2a_events in src/google/adk/a2a/converters/from_adk_event.py, around lines 205-220, where a state-only event builds Message(..., parts=[]) to carry actions metadata. Reproduce with to_a2a(...) using A2aAgentExecutor(force_new_version=True) and a before_agent_callback that sets state, then inspect task.history for the empty-parts agent message. Done when the status update and history carry no empty-parts message, with actions moved to metadata or the event skipped, and RemoteA2aAgent still reads the state delta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 22.3k
- Forks
- 4.4k
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/adk-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google/adk-python#8360 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
google/adk-python#8359 ·
Los mantenedores suelen responder en 3 días
-
Can pin to litellm version be changed?Posiblemente ocupada @llalitkumarrr la tomó hace 10 días. Abiertomodels
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
google/adk-python#8129 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
OpenAPI tools ignore operation- and path-level server overridesPosiblemente ocupada @sanketpatil06 la tomó hace 14 días. Abiertotools
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google/adk-python#8064 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
Two docstrings in openapi_tool document parameters the signatures do not acceptPosiblemente ocupada @surajksharma07 la tomó hace 17 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
google/adk-python#8024 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 3 días
Todos los issues de google/adk-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vllm-project/vllm#70030 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TigreGotico/tugaphone#408 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
gke-labs/kube-agents#7308 ·
Los mantenedores suelen responder en 1 día
-
t: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
chore
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
lugassawan/swe-workbench#841 ·