π OpenHands: AI-Driven Development
refactor: remove unused methods and constants from Session class (#4662)
tofarrbe77baea314f
diff --git a/openhands/server/session/session.py b/openhands/server/session/session.pyindex c9e2a48388..2387041663 100644--- a/openhands/server/session/session.py+++ b/openhands/server/session/session.py@@ -25,8 +25,6 @@ from openhands.runtime.utils.shutdown_listener import should_continuefrom openhands.server.session.agent_session import AgentSessionfrom openhands.storage.files import FileStore-DEL_DELT_SEC = 60 * 60 * 5-class Session:sid: str@@ -200,26 +198,10 @@ class Session:"""Sends an error message to the client."""return await self.send({'error': True, 'message': message})- async def send_message(self, message: str) -> bool:- """Sends a message to the client."""- return await self.send({'message': message})-async def send_status_message(self, message: str) -> bool:"""Sends a status message to the client."""return await self.send({'status': message})- def update_connection(self, ws: WebSocket):- self.websocket = ws- self.is_alive = True- self.last_active_ts = int(time.time())-- def load_from_data(self, data: dict) -> bool:- self.last_active_ts = data.get('last_active_ts', 0)- if self.last_active_ts < int(time.time()) - DEL_DELT_SEC:- return False- self.is_alive = data.get('is_alive', False)- return True-def queue_status_message(self, message: str):"""Queues a status message to be sent asynchronously."""# Ensure the coroutine runs in the main event loop