← ClaudeAtlas

session-containerslisted

ShipIt Docker container and session runner architecture: ContainerSessionRunner, SessionRunnerRegistry, container creation/destruction, health monitoring, idle container disposal, reconnection after disposal, graceful shutdown. Load when working on containers, runners, idle cleanup, or container debugging.
nikzlabs/shipit · ★ 5 · AI & Automation · score 73
Install: claude install-skill nikzlabs/shipit
# Session Containers & Runners This skill covers Docker container management, session runners, idle disposal, and reconnection. For session creation/activation/switching, see the `session-lifecycle` skill. ## Key Components | Component | Location | Role | |-----------|----------|------| | `SessionRunner` | `orchestrator/session-runner.ts` | In-process implementation (test-only). Spawns agent/terminal directly | | `ContainerSessionRunner` | `orchestrator/container-session-runner.ts` | Production implementation. Delegates to per-session Docker container via HTTP+SSE | | `SessionContainerManager` | `orchestrator/session-container.ts` | Docker orchestration: create, destroy, health monitor, orphan cleanup | | `SessionRunnerRegistry` | `orchestrator/session-runner.ts` | App-level map of session ID -> runner | ## Runner Lifecycle ### SessionRunnerRegistry - Maintains `Map<string, SessionRunnerInterface>` (session ID -> runner) - **`getOrCreate(sessionId, sessionDir, agentId)`**: 1. Return existing non-disposed runner if found 2. Call runner factory to create new runner 3. Register `"disposed"` listener for auto-cleanup from map 4. Wire `runner.on("idle")` -> `onRunnerIdle(sessionId)` callback - **`get(sessionId)`**: Returns runner if exists and not disposed - Max 10 concurrent runners; evicts oldest idle runner if at capacity - `disposeAll()` for graceful shutdown ### Runner Factory (Production) `buildRunnerFactory()` (in `app-lifecycle.ts`) handles three cases, key