Add some DebuggerDisplays / DebuggerTypeProxys to abstraction types (#1144)

This commit is contained in:
Stephen Toub
2025-10-03 04:51:49 -04:00
committed by GitHub
Unverified
parent c543dbaa92
commit 4daeeb0f07
7 changed files with 32 additions and 0 deletions
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
@@ -23,6 +24,7 @@ namespace Microsoft.Agents.AI;
/// unless explicitly serialized and restored.
/// </para>
/// </remarks>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public abstract class InMemoryAgentThread : AgentThread
{
/// <summary>
@@ -118,6 +120,9 @@ public abstract class InMemoryAgentThread : AgentThread
protected internal override Task MessagesReceivedAsync(IEnumerable<ChatMessage> newMessages, CancellationToken cancellationToken = default)
=> this.MessageStore.AddMessagesAsync(newMessages, cancellationToken);
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => $"Count = {this.MessageStore.Count}";
internal sealed class InMemoryAgentThreadState
{
public JsonElement? StoreState { get; set; }