Graphflow bug finding next speaker when an agent has tools
@colaso96 Thanks a lot for picking this up! @ekzhu I am pretty sure I know what the issue is but I am completely tied up this week.
[commenter abhinav-aegis]: @colaso96 Thanks a lot for picking this up! @ekzhu I am pretty sure I know what the issue is but I am completely tied up this week. However, I did a quick review and here are my comments and you are right it is to do with the tool message. ### Root Cause GraphFlow was designed to support multiple parallel speakers at each step in the graph. However, BaseGroupChatManager currently only implements a select_speaker method , which allows only one speaker to be selected at a time. As a result, GraphFlow currently returns only one of the possible valid next speakers, based on the assumption that only one agent finishes at a time. But as multiple speakers are allowed in principle by GraphFlow, to identify the agent that just finished execution, GraphFlow inspects the last message in the chat and extracts its source. The problem arises when a tool used by the agent posts a message after the agent has responded , in that case, the last message is not authored by the agent, breaking the current logic. See [this line] for the relevant code.* We look at the last message in the thread of messages and look for the source of this. --- ### 🛠️ Temporar
Context: Issue microsoft/autogen#6523 (closed, 38 comments): ### What happened? Describe the bug Graphflow doesnt seem to work as expected when an agent has access to tools. I get a runtime error mentioning that the agent is unable to find the next speaker even though that edge exists in the graph. To Reproduce I am looking to do something like this: ``` agents: - name: "spockdataset" chatenginemodel: "gpt-4.1-mini" systemmessage: | Your task is to call the "querymusesearch" tool and return 2 possible datasets to use to answer the users question toolsallowlist: ["querymusesearch"] # - name: "spoc
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.