Skip to content

Comments

fix(open-8974): detect all tool types in Google ADK agent traces#601

Open
viniciusdsmello wants to merge 1 commit intomainfrom
vini/open-8974-google-adk-tracing-not-showing-all-available-agenttools
Open

fix(open-8974): detect all tool types in Google ADK agent traces#601
viniciusdsmello wants to merge 1 commit intomainfrom
vini/open-8974-google-adk-tracing-not-showing-all-available-agenttools

Conversation

@viniciusdsmello
Copy link
Contributor

@viniciusdsmello viniciusdsmello commented Feb 23, 2026

Summary

  • Fixes tool detection in extract_agent_attributes for Google ADK tracing, which was missing raw function tools and failing to unwrap AgentTool instances
  • Adds _extract_tool_info() helper that handles all three ADK tool types: raw callables, BaseTool subclasses, and AgentTool (agent-as-a-tool pattern)
  • AgentTool entries now include type: "agent_tool" and recursively expose the wrapped agent's own tools via agent_tools

Root Cause

The extract_agent_attributes function checked hasattr(tool, "name") to detect tools, but ADK stores raw Python functions in agent.tools — functions use __name__, not name. This caused all plain function tools to be silently skipped. Additionally, AgentTool wrappers were never unwrapped to discover the inner agent's tools.

Before (broken)

{
  "tools": [
    {"name": "WeatherAgent", "description": "..."},
    {"name": "CalculatorAgent", "description": "..."}
  ]
}
  • Direct function tools (e.g. get_current_time) missing entirely
  • No visibility into wrapped agent's own tools

After (fixed)

{
  "tools": [
    {"name": "get_current_time", "description": "Returns the current time."},
    {
      "name": "WeatherAgent",
      "type": "agent_tool",
      "description": "...",
      "agent_tools": [
        {"name": "get_weather", "description": "Retrieves weather..."}
      ]
    },
    {
      "name": "CalculatorAgent",
      "type": "agent_tool",
      "description": "...",
      "agent_tools": [
        {"name": "calculate", "description": "Evaluates math..."}
      ]
    }
  ]
}

Test plan

  • Verify orchestrator pattern: direct tools + AgentTool-wrapped sub-agents all visible
  • Verify standalone agents with only function tools are detected
  • Verify mixed sub_agents + AgentTool pattern works correctly
  • Integration test with valid API keys to confirm end-to-end trace data

Closes OPEN-8974

🤖 Generated with Claude Code

@viniciusdsmello viniciusdsmello self-assigned this Feb 23, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@viniciusdsmello viniciusdsmello force-pushed the vini/open-8974-google-adk-tracing-not-showing-all-available-agenttools branch from 9294d26 to 6fd9725 Compare February 23, 2026 16:12
@viniciusdsmello viniciusdsmello added the bug Something isn't working label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant