Summary
ws-terminal.ts:95-103,190-200 — sessionPolls entries are cleaned up when all WebSocket subscribers disconnect. However, if a session is killed via the API, existing subscribers are not notified and the shared poll timer continues calling tmux.capturePane on a non-existent window, failing silently forever.
Files Affected
src/ws-terminal.ts:95-103, 190-200
Suggested Fix
When a session is killed, actively close all WebSocket connections for that session and clean up the poll entry. Or have the poll detect session death and self-terminate.
Code review finding from full codebase audit (2026-04-04)
Summary
ws-terminal.ts:95-103,190-200—sessionPollsentries are cleaned up when all WebSocket subscribers disconnect. However, if a session is killed via the API, existing subscribers are not notified and the shared poll timer continues callingtmux.capturePaneon a non-existent window, failing silently forever.Files Affected
src/ws-terminal.ts:95-103, 190-200Suggested Fix
When a session is killed, actively close all WebSocket connections for that session and clean up the poll entry. Or have the poll detect session death and self-terminate.
Code review finding from full codebase audit (2026-04-04)