@yemi33/minions 0.1.1760 → 0.1.1761

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1761 (2026-05-07)
4
+
5
+ ### Fixes
6
+ - kill engine PID only, not its tree, to preserve in-flight agents
7
+
3
8
  ## 0.1.1760 (2026-05-07)
4
9
 
5
10
  ### Fixes
package/bin/minions.js CHANGED
@@ -59,22 +59,18 @@ function readEnginePid(minionsHome) {
59
59
  }
60
60
 
61
61
  /**
62
- * Force-kill a process and its descendants by PID. The /T flag on taskkill
63
- * recurses into the process tree on Windows, which `process.kill()` does not.
64
- * On POSIX, walk pgrep first so spawned children die before the parent.
62
+ * Force-kill a single process by PID does NOT recurse into children.
63
+ * This preserves the engine→agent invariant: agents are independent processes
64
+ * spawned as children of the engine, but they must survive engine restarts so
65
+ * they can be re-attached on next start (CLAUDE.md timeouts/liveness section).
66
+ * Tree-kill (`taskkill /T`, `pgrep -P` walk) would orphan in-flight work.
65
67
  */
66
- function killPidTree(pid) {
68
+ function killPidOnly(pid) {
67
69
  if (!pid || pid === process.pid) return;
68
70
  try {
69
71
  if (process.platform === 'win32') {
70
- execSync(`taskkill /F /T /PID ${pid}`, { stdio: 'ignore', timeout: 5000, windowsHide: true });
72
+ execSync(`taskkill /F /PID ${pid}`, { stdio: 'ignore', timeout: 5000, windowsHide: true });
71
73
  } else {
72
- try {
73
- const out = execSync(`pgrep -P ${pid}`, { encoding: 'utf8', timeout: 3000 });
74
- for (const c of out.split(/\r?\n/).map(s => Number(s.trim())).filter(n => Number.isInteger(n) && n > 0)) {
75
- try { process.kill(c, 'SIGKILL'); } catch {}
76
- }
77
- } catch {}
78
74
  try { process.kill(pid, 'SIGKILL'); } catch {}
79
75
  }
80
76
  } catch {}
@@ -644,8 +640,9 @@ if (!cmd || cmd === 'help' || cmd === '--help' || cmd === '-h') {
644
640
  const oldEnginePid = readEnginePid(MINIONS_HOME);
645
641
  // 1. Graceful stop — short timeout so a hung engine can't block what follows.
646
642
  try { execSync(`node "${path.join(MINIONS_HOME, 'engine.js')}" stop`, { stdio: 'ignore', cwd: MINIONS_HOME, timeout: 10000, windowsHide: true }); } catch {}
647
- // 2. Force-kill the recorded engine PID and its tree (most reliable independent of cmdline matching).
648
- killPidTree(oldEnginePid);
643
+ // 2. Force-kill the recorded engine PID (NOT the tree — agent children must
644
+ // survive so the new engine can re-attach them via PID files).
645
+ killPidOnly(oldEnginePid);
649
646
  // 3. Free dashboard port (catches orphan dashboards with no recorded PID).
650
647
  killByPort(7331);
651
648
  // 4. Belt-and-suspenders cmdline match for anything still alive.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-07T00:40:39.172Z"
4
+ "cachedAt": "2026-05-07T00:43:24.079Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1760",
3
+ "version": "0.1.1761",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"