Remove and close a session.
(project_name: str)
| 467 | |
| 468 | |
| 469 | async def remove_session(project_name: str) -> None: |
| 470 | """Remove and close a session.""" |
| 471 | session: Optional[SpecChatSession] = None |
| 472 | |
| 473 | with _sessions_lock: |
| 474 | session = _sessions.pop(project_name, None) |
| 475 | |
| 476 | # Close session outside the lock |
| 477 | if session: |
| 478 | try: |
| 479 | await session.close() |
| 480 | except Exception as e: |
| 481 | logger.warning(f"Error closing session for {project_name}: {e}") |
| 482 | |
| 483 | |
| 484 | def list_sessions() -> list[str]: |
no test coverage detected