From ffcddb28875bec303598989b98e011e8a22db988 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Fri, 10 Jan 2025 19:12:31 -0500 Subject: [PATCH] undo stop change --- .../autogen_agentchat/teams/_group_chat/_base_group_chat.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py b/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py index cc05dd21fbda..e075d0e87660 100644 --- a/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py +++ b/python/packages/autogen-agentchat/src/autogen_agentchat/teams/_group_chat/_base_group_chat.py @@ -395,7 +395,8 @@ async def stop_runtime() -> None: await self._runtime.stop_when_idle() await self._output_message_queue.put(None) - shutdown_task: asyncio.Task[None] | None = None + shutdown_task = asyncio.create_task(stop_runtime()) + try: # Run the team by sending the start message to the group chat manager. # The group chat manager will start the group chat by relaying the message to the participants @@ -406,9 +407,6 @@ async def stop_runtime() -> None: cancellation_token=cancellation_token, ) - # After sending the start message, we create the shutdown task that will wait for the runtime to become idle. - shutdown_task = asyncio.create_task(stop_runtime()) - # Collect the output messages in order. output_messages: List[AgentEvent | ChatMessage] = [] # Yield the messsages until the queue is empty.