microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
33.42k stars 4.84k forks source link

[Issue]: order agents within a groupchat for round_robin to work #3191

Open filippopirri opened 3 months ago

filippopirri commented 3 months ago

Describe the issue

At the moment, agents added to a groupchat container are retrieved ordered by created date (descending). This clearly causes an issue with round_robin. The fix will be to keep track of the ordering (as agents are added to a groupchat container) and use that detail in ordering the agents before they are created.

Steps to reproduce

  1. Create user_proxy agent
  2. Create assistant agent
  3. Create groupchat, and add assistant agent first, user_proxy second
  4. The user_proxy agent will always be consider first in the groupchat because of current ordering logic: agent desc created date
  5. Test the groupchat with selection_method: round_robin. user_proxy will run first, and chat terminates immediately

Screenshots and logs

Screenshot_2024-07-17_at_18 23 20

Additional Information

No response

Hk669 commented 3 months ago

@filippopirri we'd greatly appreciate it if you could create a pull request. thanks

cc @victordibia