From 9169b40e26b5ef099bac967128473178ccceb1ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 01:42:17 +0000 Subject: [PATCH 1/2] Initial plan From a93f79270783492e17339def5b9e7b7c5d06ae1c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 02:11:47 +0000 Subject: [PATCH 2/2] Update Microsoft.Extensions.AI.* to 10.2.0 and fix timestamp behavior tests Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> --- dotnet/Directory.Packages.props | 18 ++++++++--------- .../AgentRunResponseUpdateExtensionsTests.cs | 20 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 5ee419114b..3536f44ff7 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -33,18 +33,18 @@ - + - + - - + + @@ -61,9 +61,9 @@ - - - + + + @@ -71,11 +71,11 @@ - + - + diff --git a/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunResponseUpdateExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunResponseUpdateExtensionsTests.cs index a653cf80f5..c75aceaf4b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunResponseUpdateExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunResponseUpdateExtensionsTests.cs @@ -42,9 +42,9 @@ public async Task ToAgentRunResponseSuccessfullyCreatesResponseAsync(bool useAsy { AgentRunResponseUpdate[] updates = [ - new(ChatRole.Assistant, "Hello") { ResponseId = "someResponse", MessageId = "12345", CreatedAt = new DateTimeOffset(1, 2, 3, 4, 5, 6, TimeSpan.Zero), AgentId = "agentId" }, + new(ChatRole.Assistant, "Hello") { ResponseId = "someResponse", MessageId = "12345", CreatedAt = new DateTimeOffset(2024, 2, 3, 4, 5, 6, TimeSpan.Zero), AgentId = "agentId" }, new(new("human"), ", ") { AuthorName = "Someone", AdditionalProperties = new() { ["a"] = "b" } }, - new(null, "world!") { CreatedAt = new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), AdditionalProperties = new() { ["c"] = "d" } }, + new(null, "world!") { CreatedAt = new DateTimeOffset(2025, 2, 3, 4, 5, 6, TimeSpan.Zero), AdditionalProperties = new() { ["c"] = "d" } }, new() { Contents = [new UsageContent(new() { InputTokenCount = 1, OutputTokenCount = 2 })] }, new() { Contents = [new UsageContent(new() { InputTokenCount = 4, OutputTokenCount = 5 })] }, @@ -62,7 +62,7 @@ public async Task ToAgentRunResponseSuccessfullyCreatesResponseAsync(bool useAsy Assert.Equal(7, response.Usage.OutputTokenCount); Assert.Equal("someResponse", response.ResponseId); - Assert.Equal(new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), response.CreatedAt); + Assert.Equal(new DateTimeOffset(2024, 2, 3, 4, 5, 6, TimeSpan.Zero), response.CreatedAt); Assert.Equal(2, response.Messages.Count); @@ -226,13 +226,13 @@ public async Task ToAgentRunResponse_AlternativeTimestampsAsync(bool useAsync) // Unix epoch (as "null") should not overwrite new(null, "b") { CreatedAt = unixEpoch }, - // Newer timestamp should overwrite + // Newer timestamp should not overwrite (first timestamp wins) new(null, "c") { CreatedAt = middle }, // Older timestamp should not overwrite new(null, "d") { CreatedAt = early }, - // Even newer timestamp should overwrite + // Even newer timestamp should not overwrite (first timestamp wins) new(null, "e") { CreatedAt = late }, // Unix epoch should not overwrite again @@ -249,20 +249,20 @@ public async Task ToAgentRunResponse_AlternativeTimestampsAsync(bool useAsync) Assert.Equal("abcdefg", response.Messages[0].Text); Assert.Equal(ChatRole.Tool, response.Messages[0].Role); - Assert.Equal(late, response.Messages[0].CreatedAt); - Assert.Equal(late, response.CreatedAt); + Assert.Equal(early, response.Messages[0].CreatedAt); + Assert.Equal(early, response.CreatedAt); } public static IEnumerable ToAgentRunResponse_TimestampFolding_MemberData() { - // Base test cases + // Base test cases - first non-null valid timestamp wins var testCases = new (string? timestamp1, string? timestamp2, string? expectedTimestamp)[] { (null, null, null), ("2024-01-01T10:00:00Z", null, "2024-01-01T10:00:00Z"), (null, "2024-01-01T10:00:00Z", "2024-01-01T10:00:00Z"), - ("2024-01-01T10:00:00Z", "2024-01-01T11:00:00Z", "2024-01-01T11:00:00Z"), - ("2024-01-01T11:00:00Z", "2024-01-01T10:00:00Z", "2024-01-01T11:00:00Z"), + ("2024-01-01T10:00:00Z", "2024-01-01T11:00:00Z", "2024-01-01T10:00:00Z"), // First timestamp wins + ("2024-01-01T11:00:00Z", "2024-01-01T10:00:00Z", "2024-01-01T11:00:00Z"), // First timestamp wins ("2024-01-01T10:00:00Z", "1970-01-01T00:00:00Z", "2024-01-01T10:00:00Z"), ("1970-01-01T00:00:00Z", "2024-01-01T10:00:00Z", "2024-01-01T10:00:00Z"), };