Repository navigation
Description
Observed Behavior
When the progress ledger's next_speaker.answer is a name that is not a participant, MagenticOrchestrator raises WorkflowWarningEvent("Invalid next speaker: <name>") and immediately calls PrepareFinalAnswerAsync, so the run completes with a "final answer" for a task that was never done. (With an empty next_speaker it silently picks the first participant.)
Expected Behavior
Treat an unknown speaker like an unparsable ledger: retry the progress ledger (up to MaxProgressLedgerRetryCount), then reset/replan, or fail the run, instead of producing a final answer. This is what the Python side now does: #9178 was fixed by #9181 ("Retry the Magentic progress ledger when it names an unknown agent"), and #9025/#9026 do the same for Group Chat. Asking for parity in .NET.
Steps to Reproduce
- Build a Magentic workflow with one participant named
WorkerandRequirePlanSignoff(false). - Use a manager whose progress ledger answers
next_speaker = "Ghost"(the repro scripts it). - Run it and inspect
run.OutgoingEvents. dotnet run -- speakerwith the code below.
Minimal Reproduction
Public repro repo: https://github.com/compilandoideas/maf-magentic-repro (dotnet run -- speaker; the repro GitHub Actions workflow runs both scenarios on Linux, see the Actions tab). Full code: Program.cs and MagenticRepro.csproj in that repo (single file, ~70 lines).
Error Messages and Stack Traces
No error. Output of `dotnet run -- speaker`:
[warning] Invalid next speaker: Ghost
[output] from=MagenticOrchestrator type=List`1 tags=[]: FINAL ANSWER (task was never completed)
[status] Idle
Package Versions
Microsoft.Agents.AI 1.27.0, Microsoft.Agents.AI.Workflows 1.27.0 (first seen on 1.19.0; Specialized/Magentic/* is unchanged on main for this path)
.NET Version
.NET 10.0 (SDK 10.0.102)
Operating System
macOS
Regression
No
Additional Context
Code path: Specialized/Magentic/MagenticOrchestrator.cs, the nextAgent == null branch after team.FirstOrDefault(agent => agent.Name == nextSpeaker).
Duplicate search (open and closed issues and PRs: "next_speaker", "Invalid next speaker", "unknown participant", "unknown agent", "progress ledger", "Magentic final answer"): only the Python reports above; nothing for .NET.
Verified on macOS with SDK 10.0.102, and on Linux in the repro repo's GitHub Actions run.
Generated by Claude Code
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
- I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-].NET: [Bug]: Magentic jumps to the final answer when the progress ledger names an unknown participant[/-][+]Python: .NET: [Bug]: Magentic jumps to the final answer when the progress ledger names an unknown participant[/+]github-actions commentedon Nov 4, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The defect is in
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/Magentic/MagenticOrchestrator.cs::RunCoordinationRoundAsyncat lines 343-349, where an unknown non-emptyNextSpeakertriggersPrepareFinalAnswerAsync. Minimal repro: runNextSpeaker_Invalid_DoesNotTriggerFinalAnswerAsync, which scripts an unsatisfied ledger namingNonExistentAgentand observes an incorrect final result.dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/MagenticOrchestrationTests.cs1.27.01.27.0