Cancel a running session. Returns True if session was running
(self, session_id: str)
| 66 | # Keep cancelled flag for a bit, clean up later if needed |
| 67 | |
| 68 | async def cancel_session(self, session_id: str) -> bool: |
| 69 | """Cancel a running session. Returns True if session was running""" |
| 70 | async with self.lock: |
| 71 | if self.running_session == session_id: |
| 72 | self.cancelled_sessions.add(session_id) |
| 73 | logger.info(f"Session {session_id[:8]} marked for cancellation") |
| 74 | return True |
| 75 | return False |
| 76 | |
| 77 | def is_cancelled(self, session_id: str) -> bool: |
| 78 | """Check if a session has been cancelled""" |