Skip to content

.NET: Align Microsoft.Agents.AI.Foundry.Hosting experimental flags to MAAI001 for MAF-specific APIs #6742

Description

@rogerbarreto

Summary

Microsoft.Agents.AI.Foundry.Hosting is inconsistent in which [Experimental(...)] diagnostic id it applies to its public APIs. Most types use DiagnosticIds.Experiments.AIOpenAIResponses (OPENAI001), while a few MAF-specific types use DiagnosticIds.Experiments.AgentsAIExperiments (MAAI001) — e.g. FoundryToolboxHealthCheck, FoundryToolboxStartupStatus, and (added in #6718) UserToolboxConsent / FoundryToolboxService.GetUserToolboxConsents.

The MAF-specific public surface should consistently use MAAI001, not OPENAI001.

Rationale

  • OPENAI001 exists to mirror the OpenAI package's experimental diagnostic, so consumers using experimental OpenAI APIs don't need an extra suppression (per the comments in dotnet/src/Shared/DiagnosticIds/DiagnosticsIds.cs). It is appropriate only for APIs that surface OpenAI experimental types.
  • The AgentServer base types this package builds on — Azure.AI.AgentServer.Responses.ResponseHandler and ResponseContext — are not marked [Experimental] (verified against Azure.AI.AgentServer.Responses 1.0.0-beta.5).
  • None of the package's public types expose OpenAI experimental types in their signatures; they are MAF hosting/agent abstractions. So OPENAI001 is a legacy/copy-paste inconsistency and MAAI001 is the correct id.

Proposed change

Switch the remaining MAF-specific [Experimental(DiagnosticIds.Experiments.AIOpenAIResponses)] usages in Microsoft.Agents.AI.Foundry.Hosting to DiagnosticIds.Experiments.AgentsAIExperiments (MAAI001):

  • AgentFrameworkResponseHandler.cs
  • AgentSessionStore.cs
  • FileSystemAgentSessionStore.cs
  • InMemoryAgentSessionStore.cs
  • FoundryAIToolExtensions.cs
  • FoundryToolboxService.cs (class-level)
  • FoundryToolboxOptions.cs
  • HostedSessionContext.cs
  • HostedSessionContextExtensions.cs
  • HostedSessionIsolationKeyProvider.cs
  • PlatformHostedSessionIsolationKeyProvider.cs
  • HostedSessionJsonUtilities.cs (2 usages)
  • HostedFoundryMemoryProviderScopes.cs
  • HostedFoundryMemoryProviderServiceCollectionExtensions.cs
  • ServiceCollectionExtensions.cs

Audit each public type before flipping: keep OPENAI001 only where a type genuinely exposes an OpenAI experimental type in its public surface (none found so far).

Notes / risk

  • Build-safe. MAAI001 is already globally suppressed in dotnet/tests/Directory.Build.props and dotnet/samples/Directory.Build.props, so consuming tests and samples keep compiling.
  • The package is pre-release (VersionSuffix=preview, package validation disabled), so changing experimental diagnostic ids carries no compatibility concern.

Acceptance criteria

  • All MAF-specific public APIs in Microsoft.Agents.AI.Foundry.Hosting use MAAI001 (or a justified OPENAI001/MEAI001 where an external experimental type is genuinely surfaced).
  • dotnet build and unit tests pass for the package and its consumers (tests, samples, integration test container).

Context

Discovered during review of #6718 (Foundry hosted-agent toolbox OAuth consent). The new consent API was already corrected to MAAI001 in that PR; this issue tracks the broader package alignment as a separate change.

Metadata

Metadata

Assignees

Labels

.NETUsage: [Issues, PRs], Target: .Net

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions