From 3f5b4fdb4efc78ba3bac5dc7a63dc585d47b9418 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 03:22:40 +0000 Subject: [PATCH] Escape JSON string values in CreateProgressLedgerResponse test helper Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/ec610c61-0a14-44e2-82fd-1cf35e85d6cc Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com> --- .../MagenticOrchestrationTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestrationTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestrationTests.cs index 1f620adec2..937e047886 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestrationTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestrationTests.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Text.Json; using System.Threading.Tasks; using FluentAssertions; using Microsoft.Agents.AI.Workflows.InProc; @@ -1287,14 +1288,16 @@ public class MagenticOrchestrationTests string isRequestSatisfiedStr = isRequestSatisfied ? "true" : "false"; string isInLoopStr = isInLoop ? "true" : "false"; string isProgressBeingMadeStr = isProgressBeingMade ? "true" : "false"; + string nextSpeakerJson = JsonSerializer.Serialize(nextSpeaker); + string instructionJson = JsonSerializer.Serialize(instructionOrQuestion); string ledgerJson = $$""" { "is_request_satisfied": { "answer": {{isRequestSatisfiedStr}}, "reason": "test reason" }, "is_in_loop": { "answer": {{isInLoopStr}}, "reason": "test reason" }, "is_progress_being_made": { "answer": {{isProgressBeingMadeStr}}, "reason": "test reason" }, - "next_speaker": { "answer": "{{nextSpeaker}}", "reason": "test reason" }, - "instruction_or_question": { "answer": "{{instructionOrQuestion}}", "reason": "test reason" } + "next_speaker": { "answer": {{nextSpeakerJson}}, "reason": "test reason" }, + "instruction_or_question": { "answer": {{instructionJson}}, "reason": "test reason" } } """;