Skip to content

.NET: Graduate message injection out of experimental#7044

Open
westey-m wants to merge 2 commits into
microsoft:mainfrom
westey-m:dotnet-gradudate-messageinjection
Open

.NET: Graduate message injection out of experimental#7044
westey-m wants to merge 2 commits into
microsoft:mainfrom
westey-m:dotnet-gradudate-messageinjection

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation & Context

Part of releasing the HarnessAgent: several of the APIs it depends on are still marked
[Experimental]. The HarnessAgent adds message injection to its pipeline on-by-default, so this
dependency 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?

    • Removed [Experimental(MAAI001)] from the three message-injection APIs (no behavior change):
      • MessageInjectingChatClient (remains public — it is the entry point callers use to enqueue
        messages via agent.GetService<MessageInjectingChatClient>()).
      • ChatClientBuilderExtensions.UseMessageInjection().
      • ChatClientAgentOptions.EnableMessageInjection.
    • Dropped the now-unused System.Diagnostics.CodeAnalysis and Microsoft.Shared.DiagnosticIds
      usings from the three edited files.
  • What is the impact of these changes?

    • Message injection is now a released, non-experimental API, unblocking it as an on-by-default
      harness dependency. This is not a breaking change: nothing is renamed, no defaults change, and
      existing (experimental) callers keep compiling — their MAAI001 suppressions simply become
      unnecessary.
    • Validated with Microsoft.Agents.AI, Microsoft.Agents.AI.Harness, and
      Microsoft.Agents.AI.UnitTests building clean (0 warnings / 0 errors) plus dotnet format
      verification. Samples and tests suppress MAAI001 globally (still required for other
      experimental types), so no sample/test changes are needed.
  • What do you want reviewers to focus on?

    • Confirmation that keeping MessageInjectingChatClient public is the right call, since it is the
      only way to enqueue messages (EnqueueMessages / GetPendingMessages).

Related Issue

Related #6964

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI review requested due to automatic review settings July 10, 2026 09:55
@westey-m westey-m marked this pull request as ready for review July 10, 2026 09:55
@giles17 giles17 added the .NET Usage: [Issues, PRs], Target: .Net label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)] from MessageInjectingChatClient, ChatClientBuilderExtensions.UseMessageInjection(), and ChatClientAgentOptions.EnableMessageInjection.
  • Removed now-unused System.Diagnostics.CodeAnalysis and Microsoft.Shared.DiagnosticIds usings 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 5 | Confidence: 95% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by westey-m's agents

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

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

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants