Skip to content

feat: add support for Claude agents to OpenInference mapper - #340

Merged
liramon2 merged 18 commits into
strands-agents:mainfrom
liramon2:claude-mapper
Aug 11, 2026
Merged

feat: add support for Claude agents to OpenInference mapper#340
liramon2 merged 18 commits into
strands-agents:mainfrom
liramon2:claude-mapper

Conversation

@liramon2

@liramon2 liramon2 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

The evals framework currently cannot evaluate agents built with Claude Agent SDK, which may be instrumented with OpenInference and produce spans with the scope openinference.instrumentation.claude_agent_sdk. This PR modifies OpenInferenceSessionMapper to map Claude Agent spans into Sessions. It includes support for unified ADOT spans and in-memory spans.

This also includes producer agnostic fixes for the following OpenInference bugs:

  • If output.value.content on execute_tool spans contained a list of text blocks, it was converted into a repr string instead having its text joined. Similarly, if output.value itself was a JSON list of content blocks, it was stored as the raw JSON string without text extraction.
  • Agent spans with an error code but no output value were rejected from conversion instead of surfaced to the judge.

Related Issues

#329

Documentation PR

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce new warnings.

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions github-actions Bot added the enhancement New feature or request label Jul 31, 2026
@liramon2

Copy link
Copy Markdown
Contributor Author

@strandly-the-agent Review this PR. Consolidate your findings into a single comment.

@github-actions github-actions Bot added the area-tracing Trace/session ingestion: providers, session mappers, extractors, telemetry/OTEL label Jul 31, 2026
@strandly-the-agent

This comment was marked as resolved.

@liramon2

liramon2 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

@strandly-the-agent Review this PR. Consolidate your findings into a single comment. As for your questions:

  • Traces with multiple invoke agent spans should be supported for multi-agent invocations
  • claude_live_spans.json is a live capture with signatures mocked
  • The lack of input.value / output.value is a deliberate design decision by the instrumentation

@strandly-the-agent

This comment was marked as resolved.

@liramon2

liramon2 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@strandly-the-agent Review this PR. Consolidate your findings into a single comment. Finding B is out of the scope of this PR and tracked in #336

@strandly-the-agent

This comment was marked as resolved.

@liramon2

liramon2 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@strandly-the-agent Review this PR. Consolidate your findings into a single comment.

@strandly-the-agent

This comment was marked as resolved.

@liramon2

liramon2 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@strandly-the-agent Review this PR. Consolidate your findings into a single comment. Mutation 4 seems attached to the 336 bug. Flatten-to-text is the right contract, but it's speculative right now.

@strandly-the-agent

This comment was marked as resolved.

Comment thread src/strands_evals/mappers/openinference_session_mapper.py
Comment thread src/strands_evals/mappers/openinference_session_mapper.py Outdated
poshinchen
poshinchen previously approved these changes Aug 10, 2026

@poshinchen poshinchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the description is updated!

@liramon2
liramon2 merged commit e82933c into strands-agents:main Aug 11, 2026
19 of 20 checks passed
sangminwoo added a commit to sangminwoo/evals that referenced this pull request Aug 11, 2026
Resolves one conflict in the OpenInference mapper's `AgentInvocationSpan` construction.
Upstream's strands-agents#340 added `metadata=metadata` from `_extract_llm_metadata`; this branch added
`system_prompt` so the skill catalog survives mapping. The two set different fields, so
both are kept, taking upstream's real metadata over this branch's `{}` placeholder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-tracing Trace/session ingestion: providers, session mappers, extractors, telemetry/OTEL enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants