-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python, .NET: [Purview] Update CorrelationId #3745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
d4d5194 to
ef85fe4
Compare
ef85fe4 to
e4f0738
Compare
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