Skip to content

[Bug]: StrandsAgent does not forward inner tool call events when an agent is used as a tool (agent-as-tool) #2304

Description

@NicolasBelliard

Pre-flight Checklist

  • I have searched existing issues and this hasn't been reported yet.
  • I am using the latest version AG-UI.

Describe the Bug

When using the agent-as-tool pattern (a Strands Agent wrapped as a tool of a parent agent), ag_ui_strands.StrandsAgent does not emit ToolCallStartEvent, ToolCallEndEvent, or ToolCallResultEvent for the tools executed by the inner sub-agent. The frontend has no visibility into sub-agent tool execution.

Steps to Reproduce

from strands import Agent, tool
from ag_ui_strands import StrandsAgent, StrandsAgentConfig, create_strands_app

# An inner agent with its own tools
inner_agent = Agent(tools=[some_tool_a, some_tool_b])

# Wrap the inner agent as a tool of the parent agent
@tool
async def research_agent(query: str):
    """A sub-agent that uses tools internally."""
    async for event in inner_agent.stream_async(query):
        yield event
    yield inner_agent.result

# Parent agent using the sub-agent as a tool
parent_agent = Agent(tools=[research_agent])

# AG-UI wiring
agui_agent = StrandsAgent(agent=parent_agent, name="MyAgent")
app = create_strands_app(agui_agent, config=StrandsAgentConfig())

# When parent_agent calls research_agent, and research_agent internally calls
# some_tool_a and some_tool_b, the frontend never receives
# ToolCallStartEvent / ToolCallEndEvent / ToolCallResultEvent
# for some_tool_a or some_tool_b.

Expected Behavior

Expected behavior

When a parent agent calls a sub-agent-as-tool, and that sub-agent executes its own tools, the frontend should receive the full tool lifecycle events (ToolCallStartEvent, ToolCallEndEvent, ToolCallResultEvent) for those inner tool calls — allowing the UI to show real-time progress.

Actual behavior

Only the parent-level tool call (the sub-agent itself) emits start/end/result events. All inner tool calls made by the sub-agent are invisible to the frontend — their events are never forwarded through the AG-UI event stream.

Environment

- `ag_ui_strands`: 0.2.3
- `strands-agents-sdk`: latest
- Python 3.12+

Screenshots

No response

Logs & Errors

Additional Context

Impact

The UI cannot show what the sub-agent is doing in real-time. For long-running sub-agents with multiple tool calls, the user sees a black box with no progress indication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions