From 0c2891f3510ad3a99187929d1b69e181801c8c03 Mon Sep 17 00:00:00 2001 From: westey <164392973+westey-m@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:54:36 +0100 Subject: [PATCH] .NET: Remove automatic messageId assignment to fix integration test (#1006) * Remove automatic messageid asssignment to fix integration test * Remove other overrides from ChatClientAgent as well. --- dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs index fe73ee1257..4f297f6eca 100644 --- a/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs @@ -145,8 +145,6 @@ public sealed class ChatClientAgent : AIAgent foreach (ChatMessage chatResponseMessage in chatResponse.Messages) { chatResponseMessage.AuthorName ??= agentName; - chatResponseMessage.MessageId ??= Guid.NewGuid().ToString("N"); - chatResponseMessage.CreatedAt ??= DateTimeOffset.UtcNow; } // Only notify the thread of new messages if the chatResponse was successful to avoid inconsistent message state in the thread. @@ -233,15 +231,12 @@ public sealed class ChatClientAgent : AIAgent throw; } - string? messageId = null; while (hasUpdates) { var update = responseUpdatesEnumerator.Current; if (update is not null) { update.AuthorName ??= this.Name; - update.CreatedAt ??= DateTimeOffset.UtcNow; - update.MessageId ??= (messageId ??= Guid.NewGuid().ToString("N")); responseUpdates.Add(update); yield return new(update) { AgentId = this.Id };