@yemi33/minions 0.1.1797 → 0.1.1798

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.1798 (2026-05-08)
4
+
5
+ ### Other
6
+ - Reap dead reattached dispatches
7
+
3
8
  ## 0.1.1797 (2026-05-08)
4
9
 
5
10
  ### Other
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-08T16:25:36.069Z"
4
+ "cachedAt": "2026-05-08T16:36:25.273Z"
5
5
  }
package/engine/timeout.js CHANGED
@@ -452,7 +452,9 @@ function checkTimeouts(config) {
452
452
  } catch { /* ENOENT — keep default */ }
453
453
 
454
454
  const confirmedDeadAtRestart = engineRestartGraceExempt?.has(item.id);
455
- if (!processAlive && (confirmedDeadAtRestart || silentMs > staleOrphanTimeout) && (Date.now() > engineRestartGraceUntil || confirmedDeadAtRestart)) {
455
+ const reattachedProcessEnded = !!procInfo?.reattached && !processAlive;
456
+ const canReapDeadProcess = confirmedDeadAtRestart || reattachedProcessEnded;
457
+ if (!processAlive && (canReapDeadProcess || silentMs > staleOrphanTimeout) && (Date.now() > engineRestartGraceUntil || canReapDeadProcess)) {
456
458
  // Last-resort PID check: lost tracked handle but OS process may still be alive.
457
459
  if (isOsPidAliveForDispatch(item.id)) {
458
460
  log('info', `Orphan check: ${item.agent} (${item.id}) silent ${silentSec}s but OS PID is alive — keeping [${_logState}]`);
@@ -477,7 +479,8 @@ function checkTimeouts(config) {
477
479
  }
478
480
  } catch (e) { log('warn', 'orphan final output completion scan: ' + e.message); }
479
481
 
480
- // No tracked process AND no recent output past stale-orphan timeout AND (grace period expired OR confirmed-dead at restart) → orphaned
482
+ // No tracked process AND no recent output past stale-orphan timeout AND (grace period expired OR confirmed-dead at restart)
483
+ // OR a re-attached process whose OS PID has since exited (no close event will fire for fake restart handles) → orphaned
481
484
  log('warn', `Orphan detected: ${item.agent} (${item.id}) — no live process tracked, silent for ${silentSec}s [logExists/logSize=${_logState}]`);
482
485
  dispatch().updateAgentStatus(item.id, AGENT_STATUS.TIMED_OUT, `Orphaned — no process, silent for ${silentSec}s`);
483
486
  // Clear session so retry starts fresh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1797",
3
+ "version": "0.1.1798",
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"