Skip to content

feat(examples): map Claude Code subagent_type to gen_ai.tool.call.arguments - #289

Closed
xxJeffreyBxx wants to merge 2 commits into
agentevals-dev:mainfrom
xxJeffreyBxx:feature/claude-code-subagent-args
Closed

xxJeffreyBxx wants to merge 2 commits into
agentevals-dev:mainfrom
xxJeffreyBxx:feature/claude-code-subagent-args

Conversation

@xxJeffreyBxx

@xxJeffreyBxx xxJeffreyBxx commented Nov 22, 2026 •

Copy link
Copy Markdown

Closes #288

It adds one statement to the transform/claude_code processor that copies subagent_type into gen_ai.tool.call.arguments on the Agent tool span.

The value is stored as a map, so there are no escaping issues.

It needs OTEL_LOG_TOOL_DETAILS=1 set in the Claude Code session. The README has been updated to reflect these details. It adds a test fixture that shows the fix works.

Testing:

  • uv run pytest was run and 2134 passed with 35 skipped. Pytest picked up the new test fixture on its own.
  • uv run ruff check --no-fix . and uv run ruff format --check . both came back clean.
  • A live check was run with Collector contrib version 0.162.0 and Claude Code version 2.1.327. A run that launched a named subagent passed a subagent check, and a run told not to launch one failed it.

Notes:

  • Only subagent_type is mapped. Claude Code also puts full_command and file_path on its spans, but I didn't include those to keep the PR focused on the subagent type. They can be added later if wanted.
  • config-revision was changed from 2 to 3, the file's comment asks any contributor to do that after an edit.

AI assistance was used to help generate the code change and the test fixture, but the description and understanding of the issue are my own.

xxJeffreyBxx and others added 2 commits November 22, 2026 00:46
…uments

With OTEL_LOG_TOOL_DETAILS=1, Claude Code puts the launched subagent on
the claude_code.tool span of the Agent tool as subagent_type. The
transform/claude_code recipe now copies it into gen_ai.tool.call.arguments
as a map, so evaluators can check which subagent a run delegated to.
Other tool arguments stay missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude_recipe_1turn_subagent is claude_native_1turn_subagent sent through
the updated transform/claude_code on Collector contrib 0.162.0. The truth
expects the Agent call with {"subagent_type":"general-purpose"} as its
arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xxJeffreyBxx

Copy link
Copy Markdown
Author

Hi all, this is my first PR to agentevals.

Can a maintainer approve the CI run so the checks can run on the PR? I'll mark it ready for review after it passes.

@krisztianfekete

Copy link
Copy Markdown
Member

Superseded by #290

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code recipe: put subagent_type into gen_ai.tool.call.arguments

2 participants