@yemi33/minions 0.1.872 → 0.1.873

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,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.872 (2026-04-11)
3
+ ## 0.1.873 (2026-04-11)
4
4
 
5
5
  ### Features
6
6
  - show last task duration in thought-process tab when agent is idle
@@ -10,6 +10,7 @@
10
10
  - optimistic running state on pipeline Run Now click
11
11
 
12
12
  ### Fixes
13
+ - short-circuit restart grace period for verifiably-dead agent processes (closes #869) (#886)
13
14
  - orphan recovery misclassifies mid-run agents as failed on engine restart
14
15
  - dep merge failures identify conflicting branch and auto-queue fix (closes #814) (#882)
15
16
  - always show doc-chat expand bar when thread is collapsed
package/engine/cli.js CHANGED
@@ -161,6 +161,7 @@ const commands = {
161
161
  }
162
162
  }
163
163
 
164
+ const hadPid = agentPid && agentPid > 0; // track before liveness check
164
165
  if (agentPid && agentPid > 0) {
165
166
  try {
166
167
  if (process.platform === 'win32') {
@@ -172,6 +173,11 @@ const commands = {
172
173
  } catch { agentPid = null; }
173
174
  }
174
175
 
176
+ // PID was found but confirmed dead — exempt from restart grace period (#869)
177
+ if (hadPid && !agentPid) {
178
+ e.engineRestartGraceExempt.add(item.id);
179
+ }
180
+
175
181
  if (agentPid) {
176
182
  // Load sessionId from session.json for steering support
177
183
  let sessionId = null;
package/engine/timeout.js CHANGED
@@ -127,6 +127,7 @@ function checkSteering(config) {
127
127
  function checkTimeouts(config) {
128
128
  const activeProcesses = engine().activeProcesses;
129
129
  const engineRestartGraceUntil = engine().engineRestartGraceUntil;
130
+ const engineRestartGraceExempt = engine().engineRestartGraceExempt;
130
131
  const { completeDispatch } = dispatch();
131
132
  const { runPostCompletionHooks } = require('./lifecycle');
132
133
 
@@ -307,8 +308,8 @@ function checkTimeouts(config) {
307
308
  const procInfo = activeProcesses.get(item.id);
308
309
  if (procInfo?._steeringAt && Date.now() - procInfo._steeringAt < 60000) continue;
309
310
 
310
- if (!hasProcess && silentMs > effectiveTimeout && Date.now() > engineRestartGraceUntil) {
311
- // No tracked process AND no recent output past effective timeout AND grace period expired → orphaned
311
+ if (!hasProcess && silentMs > effectiveTimeout && (Date.now() > engineRestartGraceUntil || engineRestartGraceExempt?.has(item.id))) {
312
+ // No tracked process AND no recent output past effective timeout AND (grace period expired OR confirmed-dead at restart) → orphaned
312
313
  log('warn', `Orphan detected: ${item.agent} (${item.id}) — no process tracked, silent for ${silentSec}s${isBlocking ? ' (blocking timeout exceeded)' : ''}`);
313
314
  dispatch().updateAgentStatus(item.id, AGENT_STATUS.TIMED_OUT, `Orphaned — no process, silent for ${silentSec}s`);
314
315
  // Clear session so retry starts fresh
package/engine.js CHANGED
@@ -146,6 +146,7 @@ const activeProcesses = new Map(); // dispatchId → { proc, agentId, startedAt
146
146
  const realActivityMap = new Map(); // dispatchId → timestamp of last REAL agent output (not engine heartbeat)
147
147
  // tempAgents imported from engine/routing.js
148
148
  let engineRestartGraceUntil = 0; // timestamp — suppress orphan detection until this time
149
+ const engineRestartGraceExempt = new Set(); // dispatch IDs with confirmed-dead PIDs at restart — bypass grace period
149
150
 
150
151
  // Per-tick cache of refs that failed to fetch — avoids repeating 30s ETIMEDOUT for same missing ref
151
152
  // Cleared at the start of each tick cycle (see tickInner)
@@ -3155,7 +3156,8 @@ module.exports = {
3155
3156
 
3156
3157
  // Dispatch management (re-exported from engine/dispatch.js)
3157
3158
  mutateDispatch, addToDispatch, isRetryableFailureReason, completeDispatch, writeInboxAlert, updateAgentStatus,
3158
- activeProcesses, realActivityMap, get engineRestartGraceUntil() { return engineRestartGraceUntil; },
3159
+ activeProcesses, realActivityMap, engineRestartGraceExempt,
3160
+ get engineRestartGraceUntil() { return engineRestartGraceUntil; },
3159
3161
  set engineRestartGraceUntil(v) { engineRestartGraceUntil = v; },
3160
3162
 
3161
3163
  // Agent lifecycle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.872",
3
+ "version": "0.1.873",
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"