Skip to content

.NET: declare Magentic protocol messages#5778

Merged
lokitoth merged 3 commits into
microsoft:mainfrom
he-yufeng:fix/magentic-protocol-messages
May 12, 2026
Merged

.NET: declare Magentic protocol messages#5778
lokitoth merged 3 commits into
microsoft:mainfrom
he-yufeng:fix/magentic-protocol-messages

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • declare the single ChatMessage and ResetChatSignal messages that MagenticOrchestrator sends at runtime
  • add a protocol regression test so the workflow descriptor keeps those outgoing message types

Fixes #5774.

To verify

  • dotnet build .\src\Microsoft.Agents.AI.Workflows\Microsoft.Agents.AI.Workflows.csproj -f net10.0 --no-restore --tl:off
  • dotnet test --project .\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj -f net10.0 --filter-class Microsoft.Agents.AI.Workflows.UnitTests.MagenticOrchestratorTests
  • dotnet test --project .\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj -f net10.0 --filter-class Microsoft.Agents.AI.Workflows.UnitTests.MagenticManagerTests
  • dotnet format .\src\Microsoft.Agents.AI.Workflows\Microsoft.Agents.AI.Workflows.csproj --verify-no-changes --no-restore
  • dotnet format .\tests\Microsoft.Agents.AI.Workflows.UnitTests\Microsoft.Agents.AI.Workflows.UnitTests.csproj --verify-no-changes --no-restore
  • git diff --check

Copilot AI review requested due to automatic review settings May 12, 2026 12:00
@moonbox3 moonbox3 added .NET workflows Related to Workflows in agent-framework labels May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Magentic orchestration protocol metadata in the .NET workflows layer by explicitly declaring the runtime outbound message types that MagenticOrchestrator sends, preventing protocol validation failures when converting workflows to AIAgent. It also adds a regression unit test to ensure these sent message types remain declared in the protocol descriptor.

Changes:

  • Declare ChatMessage and ResetChatSignal as outbound (Sends) message types in MagenticOrchestrator’s protocol configuration.
  • Add a unit test validating MagenticOrchestrator.DescribeProtocol() includes the expected Sends types (including the newly declared ones).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs Extends protocol declaration to include ChatMessage and ResetChatSignal as allowed outgoing message types.
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestratorTests.cs Adds a regression test asserting the orchestrator’s protocol declares the relevant Sends message types.

@lokitoth lokitoth self-assigned this May 12, 2026
@lokitoth
Copy link
Copy Markdown
Member

Good catch and fix, @he-yufeng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: Error while trying to use Magentic Orchestration

5 participants