Repository navigation
AgentGroupChat - Agent returning empty response #13553
Replies: 4 comments
|
We would like to gently suggest for you to have a look at our predecessor framework - Microsoft Agent Framework - in place of SK's "Agent Framework" orchestrations: https://learn.microsoft.com/en-us/agent-framework/workflows/orchestrations/. GitHub repo is: https://github.com/microsoft/agent-framework |
|
From my point of view, empty assistant turns in multi agent orchestration usually mean one of two things. Either the provider returned tool oriented or non text content that never got materialized into message.Content, or the orchestration layer treated an intermediate turn as a complete agent response. Given that you are using MCP tools plus the alpha Google connector, I would inspect the raw content items and finish reasons before looking at higher level strategy logic. If the selected agent is producing function call or structured parts without a text payload, the group chat may be advancing with what looks like an empty answer. I would also check whether your selection and termination strategies treat empty but non null turns as valid progress. That can create loops very easily once one agent starts emitting tool only responses. |
|
Hi Johnny (@joaooo), thank you for the detailed report and logs — that empty Here is how I would narrow it down, in order: 1. Log the raw message, not just the text. Before assuming the model said nothing, inspect the items and their types on the returned message: await foreach (ChatMessageContent message in chat.InvokeAsync(agent))
{
foreach (var item in message.Items)
{
Console.WriteLine($"Item: {item.GetType().Name}, Content: '{item}'");
}
}If you see a 2. Reproduce the agent on its own. Invoke 3. Remove the duplicate tool registration. In the DI code you shared, the same MCP tools are registered twice — once under kernelBuilder.Plugins.AddFromFunctions("MCPTools", tools.Select(t => t.AsKernelFunction()));
// remove the separate "test" registration of the same tools4. Treat the alpha connector as a suspect. You are on Semantic Kernel 1.70.0 with the Google connector 5. Guard the loop while you debug. Give the group chat an explicit termination strategy with a small One more note, with respect: as Evan Mattson (@moonbox3) mentioned, new agent orchestration work is moving to Microsoft Agent Framework, so for a longer-term project that migration is worth evaluating — but it is not required to fix this issue, and the diagnostics above should tell us where the empty turn comes from first. If you can share the item-type log from step 1, I will happily help interpret it. Thanks again for the thorough report! |
|
Hi Johnny (@joaooo), just checking in — did the explanation above match what you're seeing with the empty assistant turns? If it helped, would you mind marking it as the answer so others hitting the same issue can find it? Happy to dig further if it didn't fit. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
Im reaching out as an attempt to get some clarity and help in what's going on because i'm out of ideas and it might even be a silly thing.
I have implemented a AgentGroupChat with three agents: One as a 'Manager' to orchestrate the process, another one as 'DevOpsAgent' to take care of DevOps calls (such as download repo), lastly, a 'refactorAgent' that processes N files by refactoring each one of them. I also implemented my own MCP to try to simplify things as: Access to DevOps and file system operations.
The issue arrises sometimes but still +50% of the times, where one agent just starts returning empty string and seems to be stuck in a loop and nothing happens, for example:
I'm using SemanticKernel
1.70.0with Google Connector1.70.0-alphaMy DI is as follows:
In the beginning i only had one plugin which contained all the tools (devops & filesystem), but as the iterations went by, i tried filtering them out for those specific agents aswell.
My Strategy seems to be working fine, but i simply cant overcome this issue, can anyone point me in the right direction?
Thanks in advance
All reactions