Repository navigation
Propagate request sessions to Agent365 tool and inference scopes - #310
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfa03945-cb0e-4471-ba78-5980a3098d0b
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The session-propagation change has no active review issues, although no additional validation was run during this review.
No open issues 🎉
What changed in this PR
Completes Agent365 request-session propagation by recording Request.session_id on execute-tool and inference spans, matching invoke-agent behavior.
Changes:
- Sets
microsoft.session.iddirectly from the request while preserving independent conversation correlation. - Adds regression cases for present and absent session IDs without a baggage processor.
- Documents session correlation and records the fix in the changelog.
No actionable findings. No additional validation was run during this review.
| File | Description |
|---|---|
tests/a365/test_inference_scope.py |
Tests inference session presence, absence, and independent conversation IDs. |
tests/a365/test_execute_tool_scope.py |
Tests tool session propagation without a baggage processor. |
src/microsoft/opentelemetry/a365/core/inference_scope.py |
Records the request session ID on inference spans. |
src/microsoft/opentelemetry/a365/core/execute_tool_scope.py |
Records the request session ID on execute-tool spans. |
CHANGELOG.md |
Notes the Agent365 session-propagation fix. |
A365_DOCUMENTATION.md |
Explains direct session correlation and omitted-session behavior. |
Review effort: Balanced
…parity # Conflicts: # CHANGELOG.md Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfa03945-cb0e-4471-ba78-5980a3098d0b
Performance comparisonThreshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.
|
Select the released OpenAIChatCompletionClient instead of the Responses client and pass the configured Azure API version explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14661e89-86a3-4afe-a454-263eaeeba021
Radhika Gupta (rads-1996)
previously approved these changes
Oct 30, 2026
Nikhil Navakiran (nikhilNava)
enabled auto-merge (squash)
October 30, 2026 17:36
…parity # Conflicts: # CHANGELOG.md # src/microsoft/opentelemetry/a365/core/execute_tool_scope.py # tests/a365/test_execute_tool_scope.py Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Radhika Gupta (rads-1996)
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete Python's scope-level session propagation from microsoft/opentelemetry-distro-dotnet#116.
Request.session_idasmicrosoft.session.iddirectly on execute-tool and inference scopes, matching the existing invoke-agent scope.conversation_idindependently and omit the session attribute when no session is supplied.JavaScript already covers this source feature; this addresses a Python-specific partial implementation. No baggage precedence, exporter/storage policy, public signature, or dependency changes.
Validation
Python 3.11, with this branch's
srconPYTHONPATH:python -m pytest tests/a365 --ignore=tests/a365/integration -q --tb=short: 644 passed, 8 skipped, 41 subtests passed.python -m pylint --output-format=parseable: passed (10/10).python -m mypy --python-version 3.10 --show-error-codes --ignore-missing-imports --check-untyped-defs --follow-imports=silent: passed.git diff --check: passed.python -m build --no-isolation: wheel and source distribution built; both changed source files verified byte-for-byte in both artifacts.The unit run emits one exporter worker warning (
enriching_span_processor.py:449, cannot release un-acquired lock). The exact warning reproduces on unchanged main (640 passed, 8 skipped, 41 subtests passed); this PR does not change exporters.Full tox environments, Python 3.10/3.12-3.14 execution, live integration tests, Sphinx docs, and .NET/JavaScript execution were not run. No live telemetry was used.
This is an independent main-based PR. Existing Python storage work remains in #300.