Skip to content

Feature Request: Support Event Streaming propagation from AgentTool (Sub-agents) to Runner #3984

Closed

Description

@abhinav-rafa

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Is your feature request related to a problem? Please describe.
Yes, this request addresses a significant User Experience (UX) and latency issue when implementing Hierarchical Multi-Agent systems using the AgentTool pattern.

Currently, when a Parent Agent delegates a task to a Sub-agent wrapped in an AgentTool, the execution acts as a "black box" or a blocking operation.
The Parent Agent invokes the AgentTool.
The Sub-agent starts running (which may involve its own chain of thought, tool calls, and retries).
The Problem: During the Sub-agent's execution, no events are yielded to the main Runner. The application receives no feedback (no partial text, no tool call notifications) until the Sub-agent completes its entire lifecycle and returns the final string result.
If a sub-agent takes 30 seconds to complete a complex task, the frontend application appears unresponsive for 30 seconds. The developer loses visibility into the intermediate_data and intermediate_responses of the sub-agent in real-time.

Describe the solution you'd like
I would like AgentTool (and the underlying Runner logic) to support event bubbling or streaming propagation.
When an AgentTool is executed:
It should utilize the Sub-agent's run_async iterator.
It should intercept events generated by the Sub-agent (including model chunks, inner tool_calls, and tool_responses).
These events should be yielded up to the parent Runner immediately, rather than buffered until completion.
This would allow the frontend application (e.g., via adk run_sse) to display the Sub-agent's progress (e.g., "Sub-agent is searching Google...", "Sub-agent is writing code...") in real-time, maintaining a responsive UI.

Describe alternatives you've considered
Custom Orchestrator Agent: Manually implementing a custom agent class inheriting from BaseAgent and overriding _run_async_impl. Inside this manual implementation, I can call the sub-agent's run_async and manually yield the events. This works but requires significant boilerplate code and defeats the convenience of using the standard AgentTool wrapper.

Additional context
This is critical for "Coordinator -> Sub-agent" architectures.
Current behavior: Runner yields events for the Coordinator -> Silence for 20s (while Sub-agent works) -> Runner yields final answer.
Desired behavior: Runner yields Coordinator events -> Runner yields Sub-agent thought process/tool events -> Runner yields final answer.
This feature would significantly improve the usability of ADK for complex, long-running agentic workflows.

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Dec 20, 2025
  2. added theissue type on Dec 20, 2025
  3. klateefa commented on Feb 11, 2026

    @klateefa

    @abhinav-rafa Thank you for submitting this feature request. It’s currently under review by our team, and I’ll keep you posted on any updates. We appreciate your input!

  4. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Feb 11, 2026
  5. CS-PK commented on Mar 23, 2026

    @CS-PK

    Strong +1 from production use case.

    We run a multi-agent orchestrator where sub-agents are wrapped as AgentTool and also called remotely via A2A. We needed real-time progress updates in the UI ("Searching feeds...",
    "Resolving labels 3/10") while sub-agent tools execute.

    Because AgentTool.run_async() consumes all events internally (only keeps last_content), we had to build a parallel transport:

    1. /run_sse route override — we delete ADK's route and register our own that merges ADK events with heartbeat frames via asyncio.Queue
    2. A2A server executor wrapper — a custom executor that spawns a background task to drain a thread-safe queue and emit TaskStatusUpdateEvent(state=working) into the A2A event queue during tool
      execution
    3. contextvars.ContextVar to pass the heartbeat queue from the SSE handler down through create_task() → runner → AgentTool → tool function

    This works but is fragile — we're maintaining a copy of ADK's /run_sse event serialization logic, and any ADK update to that endpoint could silently break us.

    What would solve this cleanly:

    1. Event propagation from AgentTool (this issue) — if sub-agent events flowed to the parent runner, we could attach progress via custom_metadata on existing events
    2. SSE middleware hook — something like on_sse_event(event) -> list[event] that lets us inject custom frames without replacing the entire route
    3. ToolContext.emit_event() — a way for sync tool functions to push intermediate events into the runner's stream (bridging the sync/async boundary internally)

    Any of these would eliminate our /run_sse override entirely.


  6. DeanChensj commented on Jul 22, 2026

    @DeanChensj
    Collaborator

    Thank you for bringing this up! This feature request is already supported via the Single-Turn Sub-Agent pattern, which is the recommended way to compose agents in ADK 2.0.

    Instead of wrapping your sub-agent with AgentTool, you should set mode=""single_turn"" on the sub-agent and pass it directly to the parent's sub_agents list:

    sub_agent = Agent(
        name=""sub_agent"",
        mode=""single_turn"",
        input_schema=...,
        output_schema=...,
        tools=[...]
    )
    
    parent_agent = Agent(
        name=""parent_agent"",
        sub_agents=[sub_agent],
        ...
    )

    Why this works:
    Under the hood, single_turn sub-agents are executed inline by the parent agent's runner rather than starting a separate isolated runner. This allows all intermediate events (thoughts, inner tool calls, tool responses) to automatically bubble up and be streamed to your client application in real-time, solving the unresponsive UI/latency issue.

    For more details on how to set this up, please check the Single-Turn Mode Guide and the Single-Turn Sub-Agent Sample.

  7. adk-bot commented on Jul 29, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  8. added
    stale[Status] Issues which have been marked inactive since there is no user response
    request clarification[Status] The maintainer need clarification or more information from the author
    on Jul 29, 2026
  9. adk-bot commented on Aug 6, 2026

    @adk-bot
    Collaborator

    This has been automatically closed because it has been marked as stale for over 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainerrequest clarification[Status] The maintainer need clarification or more information from the authorstale[Status] Issues which have been marked inactive since there is no user response

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions