Skip to content

Add support for agent identity propagation for compiled agents in nested graph - #245

Merged
Radhika Gupta (rads-1996) merged 3 commits into
microsoft:mainfrom
rads-1996:fix-agent-identity-propagation
Aug 12, 2026
Merged

Add support for agent identity propagation for compiled agents in nested graph#245
Radhika Gupta (rads-1996) merged 3 commits into
microsoft:mainfrom
rads-1996:fix-agent-identity-propagation

Conversation

@rads-1996

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Performance comparison

Threshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.

Scenario Gating Baseline (ops/s) Candidate (ops/s) Δ % Status
azure_monitor_log yes 28,134.9 27,736.2 +1.44%
azure_monitor_span yes 159,261.0 159,235.7 +0.02%
otel_log no 32,682.9 32,334.2 +1.08%
otel_span no 47,980.0 47,773.7 +0.43%

Copilot AI 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.

Pull request overview

Adds auto-detection of nested compiled LangGraph subgraphs (“compiled agents”) so agent identity propagation uses the compiled graph’s own name (instead of the outer wrapper node name) when emitting spans.

Changes:

  • Introduces _is_subgraph_boundary(run) to detect nested compiled-graph boundaries via run.name != langgraph_node (excluding generic names).
  • Updates LangGraph node suppression and agent name resolution to keep/emphasize nested compiled-agent boundaries.
  • Adds targeted unit tests covering boundary detection, suppression behavior, and end-to-end nested span emission/naming.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/langchain/test_tracer.py Adds helper + tests for subgraph-boundary detection, name resolution, and nested span emission/suppression.
src/microsoft/opentelemetry/_genai/_langchain/_tracer.py Implements subgraph-boundary detection and integrates it into suppression and agent name resolution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rads-1996
Radhika Gupta (rads-1996) merged commit cc80e7c into microsoft:main Aug 12, 2026
12 checks passed
@rads-1996
Radhika Gupta (rads-1996) deleted the fix-agent-identity-propagation branch August 12, 2026 20:10
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.

3 participants