Uh oh!
There was an error while loading. Please reload this page.
.NET: feat: Implement Magentic Orchestration for .NET - #5595
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Implements Magentic Orchestration for .NET, adding a manager-driven planning + progress-ledger loop, orchestration events, and a fluent workflow builder.
Changes:
- Added Magentic orchestrator/manager/task-context and prompt templates to plan, coordinate rounds, track progress, and reset/replan.
- Introduced Magentic progress ledger + JSON extraction helpers and tool-call/result matching for transcript rendering.
- Added unit tests covering JSON extraction and progress-ledger state update/formatting behavior.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/TestReplayAgent.cs | Extends replay agent to support multi-turn scripted outputs for orchestrator tests. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/TestProgressLedgerState.cs | Adds a test fixture for progress-ledger JSON state + validation helpers. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticProgressLedgerTests.cs | Adds tests for extracting JSON from chat messages and validating ledger init/update/schema. |
| dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticManagerTests.cs | Adds tests for plan updates, progress-ledger retries, and final-answer preparation. |
| dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowEvent.cs | Registers Magentic orchestration events for polymorphic serialization. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/StreamingToolCallResultPairMatcher.cs | Adds helper to pair tool calls with tool results across streaming updates. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/PromptTemplates.cs | Adds prompt templates for facts, plans, progress ledger, and final answer. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticTaskContext.cs | Adds task context/state export + counters/limits and ledger integration. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs | Adds the core Magentic orchestration loop, replanning, events, and HITL plan review. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticManager.cs | Adds manager agent interactions for plan creation, ledger updates with retry, and final answer. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticConstants.cs | Adds constants for checkpoint persistence keys. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/ExecutorAgentHarness.cs | Adds an agent harness that optionally streams updates and tracks sessions. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/ChatMessageExtensions.cs | Adds transcript text extraction + fenced/embedded JSON extraction. |
| dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs | Adds agent reset handling and exposes a stable executor id helper. |
| dotnet/src/Microsoft.Agents.AI.Workflows/ResetChatSignal.cs | Adds a signal type to request agent executors reset state/session. |
| dotnet/src/Microsoft.Agents.AI.Workflows/MagenticWorkflowBuilder.cs | Adds a fluent builder to assemble Magentic workflows and wire executors/edges. |
| dotnet/src/Microsoft.Agents.AI.Workflows/MagenticProgressLedger.cs | Adds progress-ledger state management + question/schema formatting. |
| dotnet/src/Microsoft.Agents.AI.Workflows/MagenticPlanReviewResponse.cs | Adds HITL plan review response type. |
| dotnet/src/Microsoft.Agents.AI.Workflows/MagenticPlanReviewRequest.cs | Adds HITL plan review request type + helpers to approve or revise. |
| dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorEvent.cs | Updates executor events’ polymorphic serialization attributes. |
Comments suppressed due to low confidence (1)
dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorEvent.cs:1
MagenticOrchestratorEventderives fromWorkflowEvent, notExecutorEvent. Registering it as a derived type ofExecutorEventcan fail at runtime when building polymorphic metadata (derived type must be assignable to base type). Remove this[JsonDerivedType]fromExecutorEvent(keeping the registration onWorkflowEventis sufficient).
// Copyright (c) Microsoft. All rights reserved.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
73b4390 to
0378c87Compare8235d6b to
b8f4195CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Motivation and Context
Magentic Orchestration allows users to build task-solving teams of Agents easily by relying on intelligent planning and orchestration of the plan using the available team, by routing dynamically around the workflow.
Description
Implement Magentic Orchestration
Contribution Checklist