Try to start a new session. Returns False if another session is already running
(self, session_id: str)
| 49 | self.lock = asyncio.Lock() |
| 50 | |
| 51 | async def start_session(self, session_id: str) -> bool: |
| 52 | """Try to start a new session. Returns False if another session is already running""" |
| 53 | async with self.lock: |
| 54 | if self.running_session is not None: |
| 55 | return False |
| 56 | self.running_session = session_id |
| 57 | # Remove from cancelled set when starting (for regeneration cases) |
| 58 | self.cancelled_sessions.discard(session_id) |
| 59 | return True |
| 60 | |
| 61 | async def end_session(self, session_id: str): |
| 62 | """End a session""" |
no outgoing calls
no test coverage detected