Describe the bug
According to the code of the AgenGroupChat's base abstract class - AgentChat, the group chat InvokeAsync should add to the History all the messages yielded by the agent and return to its caler only the assistant response (not tools related messages).
In practice, calling agentGroupChat.InvokeAsync returns both the final assistance response and the messages with tool role.
I reviewed the AgentChat code and saw that the condition of the returned messages is:

The if condition might be the problem - I saw that in my function response message there are 2 items, one isn't from the mentioned types-

To Reproduce
Steps to reproduce the behavior:
- Create an agent (ChatCompletionAgent) with kernel that contains plugin.
- Add the agent to a group chat.
- Add to the groupChat history user message that will trigger the the plugin.
- call the groupChat.InvokeAsync()
- See the tool message that returns.
Expected behavior
Only final assistant response returns from the groupChat InvokeAsync.
Screenshots


Platform
OS: Windows
IDE: Visual Studio,
Language: C#
Source: SK NuGet package version 1.15.0
Describe the bug
According to the code of the AgenGroupChat's base abstract class - AgentChat, the group chat InvokeAsync should add to the History all the messages yielded by the agent and return to its caler only the assistant response (not tools related messages).
In practice, calling agentGroupChat.InvokeAsync returns both the final assistance response and the messages with tool role.
I reviewed the AgentChat code and saw that the condition of the returned messages is:


The if condition might be the problem - I saw that in my function response message there are 2 items, one isn't from the mentioned types-
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Only final assistant response returns from the groupChat InvokeAsync.
Screenshots

Platform
OS: Windows
IDE: Visual Studio,
Language: C#
Source: SK NuGet package version 1.15.0