From f437d06e8139c460c55b7a1e082decf07cbc21b2 Mon Sep 17 00:00:00 2001 From: tofarr Date: Thu, 27 Feb 2025 08:04:37 -0700 Subject: [PATCH] Fix for error cleaning stale (#6971) --- .../conversation_manager/standalone_conversation_manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openhands/server/conversation_manager/standalone_conversation_manager.py b/openhands/server/conversation_manager/standalone_conversation_manager.py index 7440342f36..e6503f7d4b 100644 --- a/openhands/server/conversation_manager/standalone_conversation_manager.py +++ b/openhands/server/conversation_manager/standalone_conversation_manager.py @@ -12,6 +12,7 @@ from openhands.core.schema.agent import AgentState from openhands.events.action import MessageAction from openhands.events.stream import EventStream, session_exists from openhands.server.monitoring import MonitoringListener +from openhands.server.session.agent_session import WAIT_TIME_BEFORE_CLOSE from openhands.server.session.conversation import Conversation from openhands.server.session.session import ROOM_KEY, Session from openhands.server.settings import Settings @@ -141,7 +142,10 @@ class StandaloneConversationManager(ConversationManager): sid_to_close = [ sid for sid in sid_to_close if sid not in connected_sids ] - await wait_all(self._close_session(sid) for sid in sid_to_close) + await wait_all( + (self._close_session(sid) for sid in sid_to_close), + timeout=WAIT_TIME_BEFORE_CLOSE, + ) await asyncio.sleep(_CLEANUP_INTERVAL) except asyncio.CancelledError: async with self._conversations_lock: