Skip to content

[Bug]: Wrong role set in group chat #3009

Closed
@hardchor

Description

@hardchor

Describe the bug

When running a group chat and retrieving the chat_result, all user messages are flagged as role="assistant".
This causes an issue, e.g. when using the chat_result to later on resume the conversation (or when relying on the role value to display whether a message came from the user in a UI).

Steps to reproduce

  1. Initiate a group chat
chat_result = user_proxy.initiate_chat(group_chat_manager, message="Hello world!")
  1. Send a few messages, exit & inspect the chat results

Model Used

gpt-4o

Expected Behavior

Messages coming from users (i.e. via UserProxyAgent) should be marked as role="user"

Screenshots and logs

No response

Additional Information

I noticed that https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L653 hardcodes "assistent", which is the value that ends up in self._oai_messages. Since GroupChatManager doesn't override the send function, I believe (!) this might be the culprit.

P.S.: I noticed https://github.com/microsoft/autogen/blob/main/autogen/agentchat/conversable_agent.py#L774 hardcoding "user" on the receiver side, which might cause a similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.2Issues which are related to the pre 0.4 codebasegroup chat/teamsgroup-chat-related issuesneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions