I implemented an agent to be called by an orchestrator using a2a. Both agents are running and the ADK works well with it, however since I have a long-lasting session on the sub-agent (called through a2a), I would like to send SSE messages about the progression of the task. I couldn't find examples of this application, although it is supported by a2a protocol using SSE ... from my investigation:
The A2A protocol fully supports streaming progress via Server-Sent Events (SSE):
- Method: message/stream RPC initiates a streaming connection
- Transport: Uses Content-Type: text/event-stream for SSE
- Event Types:
- TaskStatusUpdateEvent: Task state changes (submitted, working, completed, failed)
- TaskArtifactUpdateEvent: Incremental result delivery
- Event Structure: Each SSE event contains a JSON-RPC 2.0 Response with task updates
- Capability Flag: Agent cards must indicate capabilities.streaming: true The protocol is designed for this exact use case - real-time progress updates during long-running tasks.
Anyone tried this before? Any feedback of when this is going to be supported on ADK?
1 Answer 1
Custom SSE Implementation:
You can implement a lightweight SSE endpoint on your sub-agent to stream task updates back to the orchestrator. The orchestrator can then subscribe to these updates using a simple HTTPEventSource. This works well as an interim solution until ADK provides native support.Polling Workaround:
Another workaround is to periodically poll the sub-agent for progress updates through a standard A2A message. While less efficient, it maintains compatibility with the current ADK.
Comments
Explore related questions
See similar questions with these tags.