@yemi33/minions 0.1.613 → 0.1.614

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,11 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.613 (2026-04-08)
3
+ ## 0.1.614 (2026-04-08)
4
4
 
5
5
  ### Features
6
6
  - clickable pinned notes and skills with full content + doc-chat
7
7
 
8
8
  ### Fixes
9
+ - kill process holding worktree lock before removal attempt
9
10
  - dedup worktree removal attempts, add Windows rd fallback
10
11
  - accurate LLM call timing and agent metrics on engine page
11
12
  - worktree count now checks for .git file instead of any directory
package/engine/cleanup.js CHANGED
@@ -39,6 +39,44 @@ function worktreeDirMatchesBranch(dirLower, branch) {
39
39
  return dirLower === branchSlug || dirLower.includes(branchSlug + '-') || dirLower.endsWith('-' + branchSlug);
40
40
  }
41
41
 
42
+ /**
43
+ * Kill any tracked or PID-filed process whose dispatch ID appears in the worktree dir name.
44
+ * Must run BEFORE removeWorktree so file handles are released on Windows.
45
+ */
46
+ function _killProcessInWorktree(dir, activeProcesses) {
47
+ const dirLower = dir.toLowerCase();
48
+ // Check tracked active processes
49
+ for (const [id, info] of activeProcesses.entries()) {
50
+ if (dirLower.includes(id.toLowerCase().slice(-8))) {
51
+ try { shared.killImmediate(info.proc); } catch {}
52
+ activeProcesses.delete(id);
53
+ }
54
+ }
55
+ // Check PID files in engine/tmp/ — format: pid-{label}-{id}.pid
56
+ try {
57
+ const tmpDir = path.join(ENGINE_DIR, 'tmp');
58
+ for (const f of fs.readdirSync(tmpDir)) {
59
+ if (!f.startsWith('pid-') || !f.endsWith('.pid')) continue;
60
+ // Extract dispatch ID suffix from filename
61
+ const parts = f.replace(/^pid-/, '').replace(/\.pid$/, '').split('-');
62
+ const suffix = parts.slice(-1)[0];
63
+ if (suffix && dirLower.includes(suffix)) {
64
+ const pid = parseInt(fs.readFileSync(path.join(tmpDir, f), 'utf8').trim(), 10);
65
+ if (pid > 0) {
66
+ try {
67
+ if (process.platform === 'win32') {
68
+ exec(`taskkill /F /PID ${pid}`, { stdio: 'pipe', timeout: 5000, windowsHide: true });
69
+ } else {
70
+ process.kill(pid, 'SIGKILL');
71
+ }
72
+ } catch {} // process may already be dead
73
+ }
74
+ try { fs.unlinkSync(path.join(tmpDir, f)); } catch {}
75
+ }
76
+ }
77
+ } catch {} // tmp dir may not exist
78
+ }
79
+
42
80
  // ─── Cleanup Orchestrator ────────────────────────────────────────────────────
43
81
 
44
82
  function runCleanup(config, verbose = false) {
@@ -264,6 +302,8 @@ function runCleanup(config, verbose = false) {
264
302
 
265
303
  if (_attemptedWorktreePaths.has(entry.wtPath)) continue;
266
304
  _attemptedWorktreePaths.add(entry.wtPath);
305
+ // Kill any process still running in this worktree before removal
306
+ _killProcessInWorktree(entry.dir, activeProcesses);
267
307
  if (shared.removeWorktree(entry.wtPath, root, worktreeRoot)) {
268
308
  cleaned.worktrees++;
269
309
  if (verbose) console.log(` Removed worktree: ${entry.wtPath}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.613",
3
+ "version": "0.1.614",
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"