.NET: Mark constructors of InvokingContext and InvokedContext as experimental#4851
Open
westey-m wants to merge 1 commit intomicrosoft:mainfrom
Open
.NET: Mark constructors of InvokingContext and InvokedContext as experimental#4851westey-m wants to merge 1 commit intomicrosoft:mainfrom
westey-m wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Marks InvokingContext / InvokedContext constructors as experimental to discourage direct construction by consumers while keeping the rest of the APIs GA, allowing future constructor evolution without breaking changes.
Changes:
- Added
[Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)]toInvokingContext/InvokedContextconstructors. - Added
#pragma warning disable/restore MAAI001around internal framework usages of those constructors. - Added required usings for
ExperimentalAttributeand diagnostic IDs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Abstractions/MessageAIContextProvider.cs | Marks MessageAIContextProvider.InvokingContext ctor as experimental and suppresses internal call-site warnings. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/ChatHistoryProvider.cs | Marks ChatHistoryProvider.InvokingContext/InvokedContext ctors as experimental and suppresses internal call-site warnings. |
| dotnet/src/Microsoft.Agents.AI.Abstractions/AIContextProvider.cs | Marks AIContextProvider.InvokingContext/InvokedContext ctors as experimental and suppresses internal call-site warnings. |
SergeyMenshykh
approved these changes
Mar 23, 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
These types are not intended to be constructed by customers (except when testing their own custom implementations).
Keeping the constructors experimental will allow us to evolve these with additional required parameters, improving the consumption experience. The rest of these classes would be considered GA.
Description
Contribution Checklist