feat: remove docker container on shutdown

Add automatic cleanup of Docker containers when the application exits.
Uses a singleton runtime pattern and spawns a detached subprocess for
cleanup to ensure fast exit without blocking the UI.
This commit is contained in:
0xallam
2026-01-19 18:21:34 -08:00
committed by Ahmed Allam
parent a67fe4c45c
commit 8413987fcd
5 changed files with 45 additions and 2 deletions

View File

@@ -742,7 +742,10 @@ class StrixTUIApp(App): # type: ignore[misc]
def _setup_cleanup_handlers(self) -> None:
def cleanup_on_exit() -> None:
from strix.runtime import cleanup_runtime
self.tracer.cleanup()
cleanup_runtime()
def signal_handler(_signum: int, _frame: Any) -> None:
self.tracer.cleanup()