Python, .NET: [Purview] Update CorrelationId#3745
Open
Rishabh4275 wants to merge 1 commit intomicrosoft:mainfrom
Open
Python, .NET: [Purview] Update CorrelationId#3745Rishabh4275 wants to merge 1 commit intomicrosoft:mainfrom
Rishabh4275 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Purview integration to make correlation identifiers clearly attributable to Agent Framework traffic (via an @AF suffix) and to propagate a session/thread identifier through the Python middleware/processor so requests can be correlated to a conversation/thread when available.
Changes:
- Python: add
session_idpropagation intoScopedContentProcessor.process_messages()and derive correlation IDs as{session_or_guid}@AF. - Python: middleware now extracts a session/conversation ID (thread ID / conversation_id) and passes it through pre- and post-checks; tests expanded accordingly.
- .NET: update Purview metadata models to require a correlationId parameter and append
@AF; addPurviewSettingsconstructor validation forappName.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/purview/agent_framework_purview/_processor.py | Adds session_id parameter and uses it to build correlation_id with @AF; uses settings app_version instead of hard-coded "1.0". |
| python/packages/purview/agent_framework_purview/_middleware.py | Extracts session ID from AgentContext/ChatContext and forwards it into prompt/response checks. |
| python/packages/purview/agent_framework_purview/_settings.py | Updates PurviewSettings docstring wording. |
| python/packages/purview/tests/test_processor.py | Updates assertions for new _map_messages(..., session_id, user_id) call shape. |
| python/packages/purview/tests/test_middleware.py | Updates mocks for new process_messages signature and adds coverage for session_id extraction from thread/messages. |
| python/packages/purview/tests/test_chat_middleware.py | Updates mocks for new process_messages signature and adds coverage for session_id extraction from options. |
| dotnet/src/Microsoft.Agents.AI.Purview/ScopedContentProcessor.cs | Appends @AF to correlation IDs and passes correlationId via constructor. |
| dotnet/src/Microsoft.Agents.AI.Purview/PurviewSettings.cs | Adds null/whitespace validation for appName. |
| dotnet/src/Microsoft.Agents.AI.Purview/Models/Common/ProcessContentMetadataBase.cs | Requires correlationId in ctor and makes CorrelationId non-nullable. |
| dotnet/src/Microsoft.Agents.AI.Purview/Models/Common/ProcessConversationMetadata.cs | Updates ctor to accept/pass correlationId. |
| dotnet/src/Microsoft.Agents.AI.Purview/Models/Common/ProcessFileMetadata.cs | Updates ctor to accept/pass correlationId. |
| dotnet/tests/Microsoft.Agents.AI.Purview.UnitTests/PurviewClientTests.cs | Updates test helper to use new ProcessConversationMetadata(..., correlationId) constructor. |
eoindoherty1
approved these changes
Feb 7, 2026
d4d5194 to
ef85fe4
Compare
eoindoherty1
approved these changes
Feb 7, 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.
Motivation and Context
This change will help us identify the requests which come through agent framework and as a later part this should also help with debugging or if there are any issues from agent framework to Purview
Description
Adding @af to the ids to identify them.
Contribution Checklist