Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix stack trace in logs (#5751)

tofarrb51dd3bc75c7
diff --git a/openhands/server/session/manager.py b/openhands/server/session/manager.py
index b8c0a4d869..f064cfa1db 100644
--- a/openhands/server/session/manager.py
+++ b/openhands/server/session/manager.py
@@ -257,7 +257,7 @@ class SessionManager:
# Nobody replied in time
return False
finally:
- self._session_is_running_flags.pop(sid)
+ self._session_is_running_flags.pop(sid, None)
async def _has_remote_connections(self, sid: str) -> bool:
"""As the rest of the cluster if they still want this session running. Wait a for a short timeout for a reply"""
@@ -283,7 +283,7 @@ class SessionManager:
# Nobody replied in time
return False
finally:
- self._has_remote_connections_flags.pop(sid)
+ self._has_remote_connections_flags.pop(sid, None)
async def start_agent_loop(self, sid: str, session_init_data: SessionInitData):
logger.info(f'start_agent_loop:{sid}')