Skip to content

.NET: Mark constructors of InvokingContext and InvokedContext as experimental#4851

Open
westey-m wants to merge 1 commit intomicrosoft:mainfrom
westey-m:invoking-invoked-context-experimental
Open

.NET: Mark constructors of InvokingContext and InvokedContext as experimental#4851
westey-m wants to merge 1 commit intomicrosoft:mainfrom
westey-m:invoking-invoked-context-experimental

Conversation

@westey-m
Copy link
Contributor

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

  • Mark constructors of InvokingContext and InvokedContext as experimental

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings March 23, 2026 10:59
@github-actions github-actions bot changed the title Mark constructors of InvokingContext and InvokedContext as experimental .NET: Mark constructors of InvokingContext and InvokedContext as experimental Mar 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)] to InvokingContext / InvokedContext constructors.
  • Added #pragma warning disable/restore MAAI001 around internal framework usages of those constructors.
  • Added required usings for ExperimentalAttribute and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants