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 afd4e606e9..a08e0b542e 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs @@ -98,7 +98,10 @@ internal class MagenticOrchestrator(AIAgent managerAgent, List team, Ta protected override ProtocolBuilder ConfigureProtocol(ProtocolBuilder protocolBuilder) { - return base.ConfigureProtocol(protocolBuilder).ConfigureRoutes(ConfigureRoutes); + return base.ConfigureProtocol(protocolBuilder) + .SendsMessage() + .SendsMessage() + .ConfigureRoutes(ConfigureRoutes); void ConfigureRoutes(RouteBuilder routeBuilder) => routeBuilder.AddPortHandler( "RequestPlanReview", diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestratorTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestratorTests.cs new file mode 100644 index 0000000000..db091c9a95 --- /dev/null +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestratorTests.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft. All rights reserved. + +using System.Collections.Generic; +using FluentAssertions; +using Microsoft.Agents.AI.Workflows.Specialized.Magentic; +using Microsoft.Extensions.AI; + +namespace Microsoft.Agents.AI.Workflows.UnitTests; + +public class MagenticOrchestratorTests +{ + [Fact] + public void Test_MagenticOrchestrator_Protocol_Declares_SentMessages() + { + TestReplayAgent manager = new(name: nameof(MagenticOrchestrator)); + TestEchoAgent participant = new(name: "Echo"); + MagenticOrchestrator orchestrator = new(manager, [participant], new(), requirePlanSignoff: false); + + ProtocolDescriptor protocol = orchestrator.DescribeProtocol(); + + protocol.Sends.Should().Contain(typeof(List)); + protocol.Sends.Should().Contain(typeof(ChatMessage)); + protocol.Sends.Should().Contain(typeof(TurnToken)); + protocol.Sends.Should().Contain(typeof(ResetChatSignal)); + } +}