You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(scenarios): Prove a scenario's cleanup never kills a user's app #1722
Found while trimming comments in #1604. These constraints survive as comments; this issue is their encoding.
Five comments claim the same class of safety. Only the run's own tab or document may close, and a process the run did not start is never killed:
chat-close-pill-type.win.ps1 on the restart-manager pids: "Named, never killed".
chat-close-pill-type.win.ps1 on a stale WebView2 profile: a lock-holder fails the run and is never killed.
chat-close-pill-type.win.ps1 on the fullscreen app: "Evidence only".
chat-close-pill-type.win.ps1 on Find-OurTab: "Read-only".
chat-close-pill-type.sh on TextEdit: the run refuses to start when TextEdit is already open, then closes only documents it opened.
Fix: a static check or Pester test per leaf that the cleanup path never calls Stop-Process, taskkill, or pkill on a name, plus a stubbed pgrep test for the TextEdit refusal.
Shipped in #1749, now on main at 8eb8637a. Checked each part of the fix against main:
Static check per leaf:tests/scenario-cleanup-kills.test.js:79 walks every .sh and .ps1 under scripts/scenarios/ (recursively, so manual-only/ is covered) and fails on a kill by name: Stop-Process without -Id, taskkill without /PID, killall, pkill not filtered by parent or this run's count=$marks path, a kill fed by a name lookup, and .Kill() on anything but the run's own process (lines 19-45). Line 93 pins chat-close-pill-type.win.ps1 to ending processes only through Stop-FidgetTree.
Stubbed pgrep test for the TextEdit refusal: lines 203-230 stub pgrep -x TextEdit as running and assert both macOS leaves exit 1 with the refusal before touching swiftc, osascript, open, pkill or killall. Further stubbed tests cover a TextEdit that appears after the first check and before open.
Two follow-ups the PR left on purpose are filed separately: #1758 (TextEdit cleanup still closes every document by name) and #1759 (case 7 clears the pid before TextEdit has exited).
Activity
omesser commentedon Oct 21, 2026
Shipped in #1749, now on
mainat8eb8637a. Checked each part of the fix againstmain:tests/scenario-cleanup-kills.test.js:79walks every.shand.ps1underscripts/scenarios/(recursively, somanual-only/is covered) and fails on a kill by name:Stop-Processwithout-Id,taskkillwithout/PID,killall,pkillnot filtered by parent or this run'scount=$markspath, a kill fed by a name lookup, and.Kill()on anything but the run's own process (lines 19-45). Line 93 pinschat-close-pill-type.win.ps1to ending processes only throughStop-FidgetTree.pgreptest for the TextEdit refusal: lines 203-230 stubpgrep -x TextEditas running and assert both macOS leaves exit 1 with the refusal before touchingswiftc,osascript,open,pkillorkillall. Further stubbed tests cover a TextEdit that appears after the first check and beforeopen.Two follow-ups the PR left on purpose are filed separately: #1758 (TextEdit cleanup still closes every document by name) and #1759 (case 7 clears the pid before TextEdit has exited).
— Cursor agent (P. Coder), on @omesser's behalf.