Skip to content

.NET: Add Magentic Orchestration Sample#5823

Draft
Copilot wants to merge 7 commits into
mainfrom
copilot/port-magentic-orchestration-sample
Draft

.NET: Add Magentic Orchestration Sample#5823
Copilot wants to merge 7 commits into
mainfrom
copilot/port-magentic-orchestration-sample

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Motivation and Context

Ports the Python Magentic multi-agent orchestration sample to .NET, giving .NET developers a ready-to-run example of the MagenticWorkflowBuilder pattern for coordinating specialized agents on complex analytical tasks.

Description

New Magentic Orchestration Sample

Adds dotnet/samples/03-workflows/Orchestration/Magentic/ — a .NET port of the Python magentic.py workflow sample. The sample builds a MagenticWorkflowBuilder orchestration with three roles:

  • ResearcherAgent – gathers factual background information
  • CoderAgent – uses HostedCodeInterpreterTool for quantitative analysis
  • MagenticManager – plans the work, tracks progress via a ledger, and decides who acts next

Key aspects demonstrated:

  • Building a Magentic workflow with MagenticWorkflowBuilder (max rounds, stalls, resets)
  • Combining standard responses-based agents with a code-interpreter-enabled participant
  • Streaming orchestration events: initial plan, replans, and progress-ledger updates
  • Printing the final multi-agent conversation transcript
  • Graceful PauseIfInteractive that skips when stdin or stdout is redirected (CI-friendly)

Other Changes

  • Registered the new Magentic.csproj in the solution file
  • Added the sample entry to the 03-workflows/README.md index

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI and others added 2 commits May 13, 2026 19:03
Copilot AI self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 19:18
Copilot AI review requested due to automatic review settings May 13, 2026 19:18
@moonbox3 moonbox3 added documentation Improvements or additions to documentation .NET workflows Related to Workflows in agent-framework labels May 13, 2026
@github-actions github-actions Bot changed the title Port Magentic orchestration workflow sample to .NET .NET: Port Magentic orchestration workflow sample to .NET May 13, 2026
Copilot AI requested a review from lokitoth May 13, 2026 19:51
Copilot AI requested review from Copilot and removed request for Copilot May 13, 2026 19:56
Copilot AI requested review from Copilot and removed request for Copilot May 13, 2026 19:59
Copilot AI review requested due to automatic review settings May 14, 2026 02:29
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

Ports the Python Magentic multi-agent orchestration sample to .NET, adding a new console sample under samples/03-workflows/Orchestration/Magentic/ that uses MagenticWorkflowBuilder with a researcher agent, a coder agent (with HostedCodeInterpreterTool), and an LLM-backed manager. It streams orchestration events (initial plan, replans, progress-ledger updates) and prints the final transcript. The PR description also mentions an Evaluation API cleanup (removing EvalItem.ExpectedOutput / Evaluation_WorkflowExpectedOutputs), but those changes are not present in the diffs supplied for review.

Changes:

  • New Magentic orchestration sample (Program.cs, csproj, README) wiring up three agents and streaming Magentic events.
  • Solution and parent README updated to register/list the new sample.
  • (Per PR description, but not in the supplied diffs) Removal of ExpectedOutput/ground-truth evaluation surface.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
dotnet/samples/03-workflows/README.md Adds row for the new Magentic sample.
dotnet/samples/03-workflows/Orchestration/Magentic/README.md Documents prerequisites, run instructions, and expected output for the sample.
dotnet/samples/03-workflows/Orchestration/Magentic/Program.cs Implements the Magentic orchestration sample, event streaming, and transcript printing.
dotnet/samples/03-workflows/Orchestration/Magentic/Magentic.csproj New project file referencing Workflows, Foundry, and core agent assemblies.
dotnet/agent-framework-dotnet.slnx Registers the new Magentic sample project in the solution.

Comment thread dotnet/samples/03-workflows/Orchestration/Magentic/Program.cs
Comment thread dotnet/samples/03-workflows/Orchestration/Magentic/README.md
Comment thread dotnet/samples/03-workflows/Orchestration/Magentic/Program.cs
Comment on lines +184 to +194
private static void PauseIfInteractive()
{
if (Console.IsInputRedirected)
{
return;
}

Console.Write("Press Enter to continue...");
Console.ReadLine();
Console.WriteLine();
}
@lokitoth lokitoth changed the title .NET: Port Magentic orchestration workflow sample to .NET .NET: Add Magentic Orchestration Sample May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants