Skip to content

.NET: [BREAKING] Graduate HarnessAgent#7119

Draft
westey-m wants to merge 1 commit into
microsoft:mainfrom
westey-m:dotnet-gradudate-harnessagent
Draft

.NET: [BREAKING] Graduate HarnessAgent#7119
westey-m wants to merge 1 commit into
microsoft:mainfrom
westey-m:dotnet-gradudate-harnessagent

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation & Context

The HarnessAgent (in Microsoft.Agents.AI.Harness) and its public surface were marked [Experimental(MAAI001)] while the harness was pre-release. As part of graduating the harness and its building blocks toward GA (tracked under #6964 / #7117), this PR promotes the core HarnessAgent API out of experimental, while keeping the individual option properties that still engage experimental or preview features marked so callers are notified when they opt into those.

Description & Review Guide

  • What are the major changes?

    • Removed the class-level [Experimental] from HarnessAgent, HarnessAgentOptions, and ChatClientHarnessExtensions (AsHarnessAgent()), plus the now-unused using directives.
    • Individually marked the 16 HarnessAgentOptions properties that activate or configure a still-experimental / preview feature: compaction (MaxContextWindowTokens, MaxOutputTokens, CompactionStrategy, DisableCompaction), looping (LoopEvaluators, LoopAgentOptions), file store / file access (FileMemoryStore, FileAccessStore, FileAccessProviderOptions), background agents (BackgroundAgents, BackgroundAgentsProviderOptions), and shell (ShellExecutor, ShellToolName, ShellToolDescription, DisableShellToolApproval, ShellEnvironmentProviderOptions).
    • Added <NoWarn>$(NoWarn);MAAI001</NoWarn> to the Harness project so the agent's own internal composition of those experimental building blocks compiles without per-file pragmas. This only affects this project's compilation; the [Experimental] attributes on the option properties are still emitted to consumers.
  • What is the impact of these changes?
    HarnessAgent, HarnessAgentOptions, and AsHarnessAgent() become part of the stable public API surface — callers no longer need to suppress MAAI001 to use the agent. Opting into a still-experimental feature via the marked option properties continues to raise MAAI001. Graduating public API out of experimental is a breaking change, hence the [BREAKING] prefix.

    Notes:

  • What do you want reviewers to focus on?
    Whether the set of properties left marked [Experimental] correctly matches the features that are still experimental/preview, and that nothing GA was accidentally marked (or vice versa).

Related Issue

Related to #7117 (does not fully close it — the package is still pre-release and depends on the remaining graduation PRs).

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 14, 2026 18:03
@giles17 giles17 added .NET Usage: [Issues, PRs], Target: .Net breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible labels Jul 14, 2026

@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: 84% | 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

Graduates the .NET HarnessAgent surface in Microsoft.Agents.AI.Harness from [Experimental(MAAI001)] to stable by removing class-level experimental annotations, while keeping opt-in/preview capabilities explicitly marked at the individual option-property level so consumers still get MAAI001 only when enabling those features.

Changes:

  • Removed class-level [Experimental] from HarnessAgent, HarnessAgentOptions, and ChatClientHarnessExtensions (and removed now-unused using directives).
  • Added [Experimental(MAAI001)] to 16 specific HarnessAgentOptions properties that opt into experimental/preview features (compaction, looping, file access/stores, background agents, shell).
  • Suppressed MAAI001 warnings within the harness project via NoWarn so the harness can compose experimental building blocks internally without per-file pragmas.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI.Harness/Microsoft.Agents.AI.Harness.csproj Suppresses MAAI001 for this project’s compilation while still emitting experimental annotations to consumers.
dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgentOptions.cs Removes class-level experimental annotation and adds [Experimental] to the 16 opt-in/preview option properties.
dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs Removes class-level [Experimental] and cleans up now-unused experimental-related usings.
dotnet/src/Microsoft.Agents.AI.Harness/ChatClientHarnessExtensions.cs Removes class-level [Experimental] and cleans up now-unused experimental-related usings for the AsHarnessAgent() entry point.

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

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants