From 6f1ab66795778debbb975ebe904fef60037ab4bf Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 13:50:59 +0000 Subject: [PATCH] .NET: Fix DebuggerDisplay attribute in AIAgent.cs to reference existing properties (#2985) * Initial plan * Fix DebuggerDisplay attribute in AIAgent.cs to reference existing properties Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> --- dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs index b134b581d0..3314177bf1 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs @@ -19,9 +19,13 @@ namespace Microsoft.Agents.AI; /// and process user requests. An agent instance may participate in multiple concurrent conversations, and each conversation /// may involve multiple agents working together. /// -[DebuggerDisplay("{Name,nq}")] +[DebuggerDisplay("{DebuggerDisplay,nq}")] public abstract class AIAgent { + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private string DebuggerDisplay => + this.Name is { } name ? $"Id = {this.Id}, Name = {name}" : $"Id = {this.Id}"; + /// /// Gets the unique identifier for this agent instance. ///