A2A (new executor): a state-only event becomes a status update whose agent message has no parts, and it lands in task history
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 22.3k
- Fork
- 4.4k
- Merge medio
- 1g 2h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/adk-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/adk-python#8360 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
google/adk-python#8359 ·
I maintainer di solito rispondono entro 3 giorni
-
Can pin to litellm version be changed?Forse già presa @llalitkumarrr l’ha presa 10 giorni fa. Apertamodels
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
google/adk-python#8129 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
OpenAPI tools ignore operation- and path-level server overridesForse già presa @sanketpatil06 l’ha presa 14 giorni fa. Apertatools
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/adk-python#8064 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
Two docstrings in openapi_tool document parameters the signatures do not acceptForse già presa @surajksharma07 l’ha presa 17 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
google/adk-python#8024 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di google/adk-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vllm-project/vllm#70030 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TigreGotico/tugaphone#408 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
gke-labs/kube-agents#7308 ·
I maintainer di solito rispondono entro 1 giorno
-
t: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
chore
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
lugassawan/swe-workbench#841 ·