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
Add Phase 3j cleanup of lingering worker processes to /finalize
The 8-shard vitest run, parallel tsup builds, and typecheck fans sometimes
leave worker pools behind after the phase exits. They don't fail CI but
accumulate across runs and can hold file locks. New Phase 3j kills them
scoped to apps/ paths so vitest instances the user may have running
elsewhere aren't affected. Adds a Cleanup line to the Phase 4 summary and
the completion checklist.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
If Phase 3e fails only inside files the simplifier touched, revert the simplifier's edits to those files and re-run. Do NOT rewrite the test suite in Phase 3 — tests that drift because the feature branch refactored UI are a separate follow-up.
381
381
382
+
### 3j. Cleanup lingering processes
383
+
384
+
The parallel shards, typecheck, lint, and build commands in Phase 3 sometimes leave worker processes hanging after the phase exits — most commonly vitest worker pools from the 8-shard run, and tsup/esbuild workers from `npm run build`. They don't fail the CI check, but they sit in memory, can hold file locks, and pile up across repeated `/finalize` runs.
385
+
386
+
After the rest of Phase 3 passes, kill orphaned workers. Match on the project path so you only catch processes from **this** finalize run — don't nuke vitest instances the user may have running in another terminal or editor:
387
+
388
+
```bash
389
+
# List what's lingering (agent: read this before killing anything)
390
+
pgrep -fa "vitest|tsup|tsc --noEmit|eslint"| grep -E "apps/(desktop|ade-cli|web)"||echo" (no orphans)"
Never use a bare `pkill -f vitest` or `pkill -f node` — that would kill processes outside this finalize run. Always scope the pattern to `apps/desktop`, `apps/ade-cli`, or `apps/web` so only ADE-spawned workers are targeted.
404
+
405
+
Also watch for orphaned node-pty or Electron helper processes if the tests spawned subprocesses (rare, but happens):
406
+
407
+
```bash
408
+
pgrep -fa "node-pty|Electron Helper"| grep -E "apps/desktop"| head
409
+
```
410
+
411
+
Kill selectively only if the parent is clearly gone (PPID == 1 on macOS/Linux).
412
+
413
+
Report killed PIDs in the Phase 4 summary under "Cleanup" so the user can see what happened.
414
+
382
415
---
383
416
384
417
## Phase 4: Summary
@@ -411,6 +444,9 @@ If Phase 3e fails only inside files the simplifier touched, revert the simplifie
411
444
- Build (all apps): PASS
412
445
- Doc validation: PASS
413
446
447
+
### Cleanup:
448
+
- Orphan processes killed: N (PIDs: [list] or "none")
449
+
414
450
### Status: Ready to push / Issues found
415
451
```
416
452
@@ -429,3 +465,4 @@ Before marking complete:
429
465
-[ ] All tests passed (desktop sharded 8-way + ade-cli)
430
466
-[ ] All apps build successfully
431
467
-[ ] Doc validation passed
468
+
-[ ] Orphan worker processes cleaned up (vitest/tsup/tsc) — scoped to apps/ paths only
0 commit comments