.NET: Graduate message injection out of experimental#7044
Open
westey-m wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR graduates the .NET “message injection” feature from experimental to released API surface by removing the [Experimental(MAAI001)] annotations on the three public entry points used by the harness pipeline and custom chat client stacks.
Changes:
- Removed
[Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)]fromMessageInjectingChatClient,ChatClientBuilderExtensions.UseMessageInjection(), andChatClientAgentOptions.EnableMessageInjection. - Removed now-unused
System.Diagnostics.CodeAnalysisandMicrosoft.Shared.DiagnosticIdsusings from the affected files.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/ChatClient/MessageInjectingChatClient.cs | Removes the experimental attribute and related unused usings from the public decorator type. |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientBuilderExtensions.cs | Removes the experimental attribute and related unused usings from UseMessageInjection(). |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgentOptions.cs | Removes the experimental attribute and related unused usings from EnableMessageInjection. |
| public void EnqueueMessages(AgentSession session, IEnumerable<ChatMessage> messages) | ||
| /// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests.</param> | ||
| /// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> | ||
| public async Task EnqueueMessagesAsync(AgentSession session, IEnumerable<ChatMessage> messages, CancellationToken cancellationToken = default) |
rogerbarreto
approved these changes
Jul 10, 2026
peibekwe
approved these changes
Jul 10, 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 & Context
Part of releasing the
HarnessAgent: several of the APIs it depends on are still marked[Experimental]. TheHarnessAgentadds message injection to its pipeline on-by-default, so thisdependency must be graduated to a released, non-experimental API before the harness can ship without
pulling users into experimental surface. This continues the work started in #6970 (which graduated
per-service-call persistence and approval-not-required function bypassing).
Description & Review Guide
What are the major changes?
[Experimental(MAAI001)]from the three message-injection APIs (no behavior change):MessageInjectingChatClient(remains public — it is the entry point callers use to enqueuemessages via
agent.GetService<MessageInjectingChatClient>()).ChatClientBuilderExtensions.UseMessageInjection().ChatClientAgentOptions.EnableMessageInjection.System.Diagnostics.CodeAnalysisandMicrosoft.Shared.DiagnosticIdsusings from the three edited files.
What is the impact of these changes?
harness dependency. This is not a breaking change: nothing is renamed, no defaults change, and
existing (experimental) callers keep compiling — their
MAAI001suppressions simply becomeunnecessary.
Microsoft.Agents.AI,Microsoft.Agents.AI.Harness, andMicrosoft.Agents.AI.UnitTestsbuilding clean (0 warnings / 0 errors) plusdotnet formatverification. Samples and tests suppress
MAAI001globally (still required for otherexperimental types), so no sample/test changes are needed.
What do you want reviewers to focus on?
MessageInjectingChatClientpublic is the right call, since it is theonly way to enqueue messages (
EnqueueMessages/GetPendingMessages).Related Issue
Related #6964
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.