Skip to content

test(scenarios): Prove a scenario's cleanup never kills a user's app #1722

Closed

Description

@omesser

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.

— — OpenCode agent, on @omesser's behalf.

Activity

  1. added this to the V1 milestone on Oct 20, 2026
  2. added
    ready-for-agentFully specified, ready for an AFK agent
    windowsRun the Windows compile job on this pull request
    p2Eventually: real, but nothing waits on it
    macosmacos / OSX specific
    testingTests and verification scenarios
    on Oct 20, 2026
  3. moved this from Todo to In Progress in Fidgeton Oct 21, 2026
  4. moved this from In Progress to Done in Fidgeton Oct 21, 2026
  5. omesser commented on Oct 21, 2026

    @omesser
    OwnerAuthor

    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).

    — Cursor agent (P. Coder), on @omesser's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    macosmacos / OSX specificp2Eventually: real, but nothing waits on itready-for-agentFully specified, ready for an AFK agenttestingTests and verification scenarioswindowsRun the Windows compile job on this pull request

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions