An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hello,
Welcome to Microsoft Q&A,
In GroupChatOrchestration, a few small contract details determine whether the manager advances to the next agent. The symptoms you described (hang right after yield return) usually come from one of these:
- Message attribution doesn’t match the speaking agent
- The group-chat manager relies on the message role + author name to know which agent just spoke. If you return a
ChatMessageContentwhoseAuthorNamedoesn’t match the agent that was selected to speak, the orchestration history won’t advance correctly. Fix: setAuthorName = this.Name(or the exact name the manager used when it picked this agent). - https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-orchestration/group-chat?pivots=programming-language-csharp
- The group-chat manager relies on the message role + author name to know which agent just spoke. If you return a
- Missing/incorrect finish metadata
- The manager looks at the finish reason of the last chunk to know that the agent has finished talking. In current SK builds, the value is
"Stop"(capital S). Lower-case"stop"from older SDKs won’t be recognized. Fix:message.Metadata["FinishReason"] = "Stop";(exact casing). - https://learn.microsoft.com/en-us/semantic-kernel/support/migration/v2-openai-migration-guide
- The manager looks at the finish reason of the last chunk to know that the agent has finished talking. In current SK builds, the value is
- Thread association is null or wrong
- Each response must be associated with the same
AgentThreadthe orchestration passed in; that’s how the runtime adds your message to the shared chat history. Fix: Returnnew AgentResponseItem(message, thread)and ensurethreadis notnull. If the framework ever calls you withthread == null, create aChatHistoryAgentThreadand reuse it for subsequent turns.
- Each response must be associated with the same
- Custom manager is pausing for input / not selecting the next agent
- If
CustomGroupChatManager.ShouldRequestUserInput(..)returnstrue, the orchestration pauses, which looks like a hang. Likewise, a selection strategy that repeatedly picks the same agent or never picks anyone after your turn will stall progress. Test: Swap in the stockRoundRobinGroupChatManagerand try again. If that runs, the issue is in your manager’s selection/termination logic. - https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-orchestration/group-chat?pivots=programming-language-csharp
- If
Please Upvote and accept the answer if it helps!!