Skip to content

setup_adk() does not trace tool calls in nested sub-agents #126

@sm-stripe

Description

@sm-stripe

Summary

Tool calls inside sub-agents nested under ParallelAgent or SequentialAgent are not captured by setup_adk()tool_calls always shows 0 in experiment results even when tools are being invoked.

Agent structure

root_agent = SequentialAgent(
    sub_agents=[
        ParallelAgent(
            sub_agents=[
                Agent(tools=[my_tool], ...),  # tool calls here are not traced
            ]
        ),
        Agent(...),
    ]
)

Steps to reproduce

  1. Call setup_adk() before running an ADK pipeline with the above structure
  2. Run an eval via braintrust.EvalAsync()
  3. Observe that tool_calls is 0 in the experiment summary, even when tools are demonstrably being invoked (e.g. eval scores that depend on tool output are correct)

Expected behavior

Tool calls inside sub-agents at any nesting depth should be traced and counted by setup_adk(), consistent with how LLM calls are traced across all nesting levels.

Actual behavior

llm_calls correctly reflects calls at all nesting levels, but tool_calls is always 0 for tools that live inside ParallelAgent or SequentialAgent sub-agents.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions