Skip to content

Conversation

@SergeyMenshykh
Copy link
Member

Motivation and Context

Today, AIAgent.DisplayName does not represent the agent's display name; it is just a fallback mechanism from the agent's name to the agent's Id if no name is specified. This can be confusing, quite opinionated and not necessarily what consumers want for their scenarios. The AIAgent class has Id and Name properties that provide agents with uniqueness and human-readable components. Consumers may use these properties separately or together instead of the DisplayName property to implement their scenarios.

Contributes to: #2542

@SergeyMenshykh SergeyMenshykh self-assigned this Dec 10, 2025
Copilot AI review requested due to automatic review settings December 10, 2025 16:04
@SergeyMenshykh SergeyMenshykh moved this to In Review in Agent Framework Dec 10, 2025
@markwallace-microsoft markwallace-microsoft added .NET workflows Related to Workflows in agent-framework labels Dec 10, 2025
@github-actions github-actions bot changed the title .Net: [Breaking] Delete display name property .NET: [Breaking] Delete display name property Dec 10, 2025
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

This PR removes the AIAgent.DisplayName property, which was a convenience property that returned Name ?? Id. The removal reduces confusion and allows consumers to directly use the Name and Id properties according to their specific needs.

Key Changes

  • Removed the DisplayName property from AIAgent class
  • Updated all usages to explicitly use Name ?? Id pattern
  • Updated method signatures in A2A module to remove displayName parameter

Reviewed changes

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

Show a summary per file
File Description
dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs Removed the DisplayName property and its documentation
dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs Removed displayName field and override, updated constructor
dotnet/src/Microsoft.Agents.AI.A2A/Extensions/A2AClientExtensions.cs Removed displayName parameter from GetAIAgent method
dotnet/src/Microsoft.Agents.AI/OpenTelemetryAgent.cs Updated activity display name logic to use conditional Name ?? Id pattern
dotnet/src/Microsoft.Agents.AI.Workflows/HandoffsWorkflowBuilder.cs Updated error messages to use Name ?? Id for agent references
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/HandoffAgentExecutor.cs Replaced DisplayName with Name ?? Id pattern in message handling
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AgentRunStreamingExecutor.cs Updated message role change logic to use Name ?? Id
dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/EndpointRouteBuilderExtensions.ChatCompletions.cs Updated endpoint agent name to use Name ?? Id
dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/EndpointRouteBuilderExtensions.Responses.cs Updated endpoint agent name to use Name ?? Id
dotnet/src/Microsoft.Agents.AI.DevUI/EntitiesApiExtensions.cs Updated entity name to use Name ?? Id
dotnet/samples/GettingStarted/AgentProviders/Agent_With_CustomImplementation/Program.cs Updated to use Name instead of DisplayName, adjusted parameter nullability
dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/A2AAgentTests.cs Removed displayName-related test assertions and variable
dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/Extensions/A2AClientExtensionsTests.cs Removed displayName parameter from test
dotnet/tests/Microsoft.Agents.AI.UnitTests/LoggingAgentTests.cs Removed DisplayName assertion from test
dotnet/tests/Microsoft.Agents.AI.UnitTests/OpenTelemetryAgentTests.cs Removed DisplayName assertion, updated activity display name assertions with conditional logic
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/TestEchoAgent.cs Updated AuthorName to use Name ?? Id
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/12_HandOff_HostAsAgent.cs Updated AuthorName to use Name ?? Id

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

Labels

.NET workflows Related to Workflows in agent-framework

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants