-
Notifications
You must be signed in to change notification settings - Fork 891
.NET: [Breaking] Delete display name property #2758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
.NET: [Breaking] Delete display name property #2758
Conversation
There was a problem hiding this 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
DisplayNameproperty fromAIAgentclass - Updated all usages to explicitly use
Name ?? Idpattern - Updated method signatures in A2A module to remove
displayNameparameter
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 |
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/HandoffAgentExecutor.cs
Outdated
Show resolved
Hide resolved
…entExecutor.cs Co-authored-by: Copilot <[email protected]>
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