[dotnet-code] Simplify group chat dispatch internals - #860
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Refactors the Go groupChatHostExecutor turn flow by extracting next-agent selection and turn-token dispatch into a focused unexported helper, aligning the internal structure more closely with the referenced .NET GroupChatHost flow while preserving behavior.
Changes:
- Extracted next-agent selection + dispatch logic into
dispatchNextAgent. - Simplified
handleTurnby delegating dispatch/complete branching to the helper’s result.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Parity Review — Approved ✅This PR only extracts the unexported The refactor mirrors the structural separation already present in the upstream .NET Scope verdict: internal implementation change — no public API surface affected.
|
Summary
Extracted the GroupChat host's next-agent selection and turn-token dispatch into an unexported
dispatchNextAgenthelper. This keeps the existing behavior intact while making the Go host structure closer to the .NETGroupChatHostflow, where history update, broadcast, selection, dispatch, and completion are separated into focused steps..NET Reference
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/GroupChatHost.cs- separates the group chat host turn flow into broadcast and completion helpers around the manager's next-agent selection and dispatch path.Public API and Behavior
No public Go API changed. No intentional behavior change was made.
Tests
go test ./workflow/agentworkflowNotes
Rejected sampled candidates:
dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/HandoffStartExecutor.cs- no corresponding Go handoff workflow implementation was found in this checkout.dotnet/src/Microsoft.Agents.AI.Workflows/Checkpointing/EdgeIdConverter.cs- the EdgeId dictionary-key converter pattern is .NET-specific; the Go workflow JSON paths use different marshal/unmarshal shapes.dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/AddConversationMessageExecutor.cs- no narrow corresponding Go declarative executor surface was found for a safe production-code cleanup.Open
[dotnet-code]PRs checked before editing; none targeted GroupChat.Closes #841