bug: Window-placement jobs not cleaned from tmux on cleanup
Description
When mc_cleanup runs, it only kills tmux sessions — jobs that were launched with placement: 'window' are skipped entirely, leaving orphaned tmux windows.
Steps to Reproduce
- Launch a job with window placement:
mc_launch(name: "test-window", prompt: "...", placement: "window") - Wait for the job to complete.
- Run
mc_cleanup(name: "test-window"). - Check tmux — the window still exists.
Expected Behavior
mc_cleanup should kill tmux windows for window-placement jobs, not just sessions.
Actual Behavior
// src/tools/cleanup.ts:57-59
if (job.placement === 'session' && await sessionExists(job.tmuxTarget)) {
try { await killSession(job.tmuxTarget); } catch {}
}
Only placement === 'session' jobs have their tmux resources cleaned up. Window-placement jobs are silently skipped.
Proposed Fix
Add a branch for window-placement cleanup. The tmux target for windows uses session:window format, so use tmux kill-window -t {target}:
if (job.placement === 'session' && await sessionExists(job.tmuxTarget)) {
try { await killSession(job.tmuxTarget); } catch {}
} else if (job.placement === 'window') {
try { await killWindow(job.tmuxTarget); } catch {}
}
May need to add a killWindow() helper to tmux.ts if one doesn't exist.
Files Involved
src/tools/cleanup.ts:57-59— cleanup logic only handles sessionssrc/lib/tmux.ts— may need akillWindow()function
Additional Context
Identified in the master audit report (Section 7: Robustness). This is a good first issue — small scope, clear fix, and teaches the tmux/cleanup code paths.
Closing as obsolete with Mission Control 2.0 (#94): placement (session/window) and tmux are removed, so window-placement jobs no longer exist.