Skip to content

Clean up automation process groups on ordinary completion - #6507

Merged
ymichael merged 2 commits into
mainfrom
slopcop/issue-6505
Oct 29, 2026
Merged

ymichael merged 2 commits into
mainfrom
slopcop/issue-6505

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

The automations script runner cleared its timers at process close but only killed remaining process-group members after timeout or output overflow. Ordinary successful or failed completion therefore left unreferenced workers alive. Reproduction and root-cause report: reproduced twice on clean trusted main checkouts at 0950d00f962029433790f9fed432c7061051a32e.

What changed

  • Use the existing process-group cleanup unconditionally at the close boundary, preserving script results and the Windows direct-child fallback.
  • Extend the existing containment tests with real Node workers using ignored stdio and parent exit codes 0 and 7; each case cleans up its own worker even when the assertion fails.
  • Document completion cleanup and its process-group/platform limits. No protocol, schema, dependency, configuration, packaging, or stored-data changes.
  • Changed-line count against origin/main: 61 total text lines (56 additions + 5 deletions), 3 files, all within automations; no binaries.

How you verified

  • Before the production change, the authored regression failed both worker-liveness assertions in two separate clean checkouts of trusted main. PID, original exit code and non-timeout assertions passed first.
  • pnpm exec turbo run test --filter=bb-plugin-automations -- src/automations.test.ts -t 'script process containment': 3 passed, including existing timeout cleanup.
  • pnpm exec turbo run test --filter=bb-plugin-automations: 142 passed across 12 files.
  • pnpm exec turbo run lint typecheck --filter=bb-plugin-automations: passed; lint reports four existing React-effect warnings in unchanged UI code.
  • pnpm exec oxfmt --check plugins/automations/src/automations.test.ts plugins/automations/src/script-runner.ts plugins/automations/skills/automations/references/script-runtime.md: passed.
  • git diff --check: passed. Diff reviewed for scope, lifecycle correctness, and binary/generated changes.
  • Direct runner verification on Linux, Node 22.19.0; macOS desktop shutdown, Windows descendant termination and memory pressure were not exercised. No live bb instance was started. The verification-skill inventory check reports pre-existing unmapped diagnostics CLI coverage; that unrelated map was not changed.

Fixes #6505

AGENT GENERATED

Quitting bb, or reloading, disabling, or updating the automations plugin,
left running scripts and their process groups alive, while the next start
marked those runs interrupted and let the schedule start another copy.

Script runs now go through a per-plugin run scope. Its dispose hook sends
SIGTERM to each running script's process group, escalates to SIGKILL after
one second, and waits for the runs to be recorded as skipped with an
interrupted reason before the plugin database closes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 24a5b76 into main Oct 29, 2026
44 checks passed
@ymichael
ymichael deleted the slopcop/issue-6505 branch October 29, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Processes started by an automation script keep running after the script ends, and after bb quits

2 participants