From 13e53eec8f8f3a003cdef501bc2a8902abaed49c Mon Sep 17 00:00:00 2001 From: Shyju Krishnankutty Date: Tue, 17 Feb 2026 18:31:07 -0800 Subject: [PATCH] PR feedback fixes. --- .../Workflows/DurableStreamingWorkflowRun.cs | 7 +++---- .../Workflows/DurableWorkflowRunner.cs | 1 - .../DurableStreamingWorkflowRunTests.cs | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableStreamingWorkflowRun.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableStreamingWorkflowRun.cs index 25bff4148b..07b76f60c1 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableStreamingWorkflowRun.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableStreamingWorkflowRun.cs @@ -127,7 +127,6 @@ internal sealed class DurableStreamingWorkflowRun : IStreamingWorkflowRun } } - // On terminal status, re-fetch with outputs to get the final result. // Check terminal states after draining events from custom status if (metadata.RuntimeStatus == OrchestrationRuntimeStatus.Completed) { @@ -304,7 +303,7 @@ internal sealed class DurableStreamingWorkflowRun : IStreamingWorkflowRun return (TResult)(object)resultJson; } - return JsonSerializer.Deserialize(resultJson); + return JsonSerializer.Deserialize(resultJson, DurableSerialization.Options); } // Fallback: the output is not wrapped in DurableWorkflowResult. @@ -320,7 +319,7 @@ internal sealed class DurableStreamingWorkflowRun : IStreamingWorkflowRun if (innerString is not null) { - return JsonSerializer.Deserialize(innerString); + return JsonSerializer.Deserialize(innerString, DurableSerialization.Options); } } catch (JsonException) @@ -333,7 +332,7 @@ internal sealed class DurableStreamingWorkflowRun : IStreamingWorkflowRun return (TResult)(object)serializedOutput; } - return JsonSerializer.Deserialize(serializedOutput); + return JsonSerializer.Deserialize(serializedOutput, DurableSerialization.Options); } [UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Deserializing workflow event types.")] diff --git a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs index bdd045213d..62cddb5386 100644 --- a/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs +++ b/dotnet/src/Microsoft.Agents.AI.DurableTask/Workflows/DurableWorkflowRunner.cs @@ -177,7 +177,6 @@ internal sealed class DurableWorkflowRunner if (haltRequested) { - logger.LogWorkflowCompleted(); break; } diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs index 8a291ddf93..5c6c9afc2b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Workflows/DurableStreamingWorkflowRunTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Text.Json; using Microsoft.Agents.AI.DurableTask.Workflows; @@ -587,6 +587,23 @@ public sealed class DurableStreamingWorkflowRunTests Assert.Equal(42, result.Value); } + [Fact] + public void ExtractResult_CamelCaseSerializedObject_DeserializesToPascalCaseMembers() + { + // Arrange — executor outputs are serialized with DurableSerialization.Options (camelCase) + TestPayload original = new() { Name = "camel", Value = 99 }; + string resultJson = JsonSerializer.Serialize(original, DurableSerialization.Options); + string serializedOutput = SerializeWorkflowResult(resultJson, []); + + // Act + TestPayload? result = DurableStreamingWorkflowRun.ExtractResult(serializedOutput); + + // Assert + Assert.NotNull(result); + Assert.Equal("camel", result.Name); + Assert.Equal(99, result.Value); + } + #endregion private sealed class TestPayload