mirror of https://github.com/microsoft/autogen.git
Merge pull request #3528 from SailorJoe6/Issue_#3527_studio_forever_error_loop
Fix for Issue #3527 - Studio - Never Ending Error Loop
This commit is contained in:
commit
8bcb720e0a
|
@ -46,7 +46,13 @@ def message_handler():
|
|||
logger.info(
|
||||
f"Sending message to connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
||||
)
|
||||
asyncio.run(websocket_manager.send_message(message, connection))
|
||||
coro = websocket_manager.send_message(message, connection)
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
asyncio.run_coroutine_threadsafe(coro, loop)
|
||||
except RuntimeError:
|
||||
asyncio.run(coro)
|
||||
|
||||
else:
|
||||
logger.info(
|
||||
f"Skipping message for connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
||||
|
|
|
@ -930,7 +930,7 @@ class ExtendedConversableAgent(autogen.ConversableAgent):
|
|||
request_reply: Optional[bool] = None,
|
||||
silent: Optional[bool] = False,
|
||||
):
|
||||
if self.message_processor:
|
||||
if self.message_processor and not self.a_human_input_function:
|
||||
self.message_processor(sender, self, message, request_reply, silent, sender_type="agent")
|
||||
super().receive(message, sender, request_reply, silent)
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ class ExtendedGroupChatManager(autogen.GroupChatManager):
|
|||
request_reply: Optional[bool] = None,
|
||||
silent: Optional[bool] = False,
|
||||
):
|
||||
if self.message_processor:
|
||||
if self.message_processor and not self.a_human_input_function:
|
||||
self.message_processor(sender, self, message, request_reply, silent, sender_type="groupchat")
|
||||
super().receive(message, sender, request_reply, silent)
|
||||
|
||||
|
|
Loading…
Reference in New Issue