From c0f1580772db7bc021d830ecfc46baedb8da3ee0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 May 2026 15:43:47 +0000 Subject: [PATCH] Fix MagenticOrchestrator dropping participant responses from chat history (#6173) --- .../Specialized/Magentic/MagenticOrchestrator.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs index ff85a65c71..5680fde028 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs @@ -195,7 +195,15 @@ internal class MagenticOrchestrator(AIAgent managerAgent, List team, Ta } else { - // Subsequent turns: agent returned control, go directly to coordination (progress ledger only, no replan) + // Subsequent turns: agent returned control. The accumulated messages are the + // participant's response(s); add them to ChatHistory so the next coordination + // round (and the manager's progress ledger) can observe what was produced. + // See https://github.com/microsoft/agent-framework/issues/6173. + if (messages.Count > 0) + { + this._taskContext.ChatHistory.AddRange(messages); + } + await this.RunCoordinationRoundAsync(this._taskContext, context, cancellationToken).ConfigureAwait(false); } }