@yemi33/minions 0.1.457 → 0.1.459

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,8 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.457 (2026-04-07)
3
+ ## 0.1.459 (2026-04-07)
4
4
 
5
5
  ### Fixes
6
+ - steering no longer causes pending/active flip
7
+
8
+ ## 0.1.458 (2026-04-07)
9
+
10
+ ### Fixes
11
+ - steering resume failure no longer burns retry slots or flips status
6
12
  - shared-branch worktree creates branch from main if not found
7
13
  - pre-dispatch live vote check prevents reviewing approved PRs
8
14
 
package/engine/timeout.js CHANGED
@@ -84,6 +84,7 @@ function checkSteering(config) {
84
84
  // Store steering context for re-spawn on close
85
85
  info._steeringMessage = message;
86
86
  info._steeringSessionId = sessionId;
87
+ info._steeringAt = Date.now(); // prevent timeout checker from treating this as orphaned
87
88
  }
88
89
  }
89
90
 
@@ -203,6 +204,10 @@ function checkTimeouts(config) {
203
204
 
204
205
  const effectiveTimeout = isBlocking ? blockingTimeout : heartbeatTimeout;
205
206
 
207
+ // Skip recently-steered agents — they're being killed and re-spawned
208
+ const procInfo = activeProcesses.get(item.id);
209
+ if (procInfo?._steeringAt && Date.now() - procInfo._steeringAt < 60000) continue;
210
+
206
211
  if (!hasProcess && silentMs > effectiveTimeout && Date.now() > engineRestartGraceUntil) {
207
212
  // No tracked process AND no recent output past effective timeout AND grace period expired → orphaned
208
213
  log('warn', `Orphan detected: ${item.agent} (${item.id}) — no process tracked, silent for ${silentSec}s${isBlocking ? ' (blocking timeout exceeded)' : ''}`);
@@ -242,6 +247,9 @@ function checkTimeouts(config) {
242
247
  if (item.status !== WI_STATUS.DISPATCHED) continue;
243
248
  // Never revert completed items
244
249
  if (item.completedAt || item.status === WI_STATUS.DONE) continue;
250
+ // Skip recently-steered agents (being killed and re-spawned)
251
+ const steerInfo = activeProcesses.get(item.id) || [...activeProcesses.values()].find(p => p.agentId && item.dispatched_to === p.agentId);
252
+ if (steerInfo?._steeringAt && Date.now() - steerInfo._steeringAt < 60000) continue;
245
253
  // Check if any active dispatch references this item
246
254
  const projectNames = getProjects(config).map(p => p.name);
247
255
  const possibleKeys = [
package/engine.js CHANGED
@@ -618,11 +618,23 @@ function spawnAgent(dispatchItem, config) {
618
618
  });
619
619
 
620
620
  // Re-wire close handler for the resumed process
621
- resumeProc.on('close', onAgentClose);
621
+ resumeProc.on('close', (resumeCode) => {
622
+ if (resumeCode !== 0) {
623
+ // Resume failed — don't burn a retry slot. Complete the dispatch as success
624
+ // (the original work was already done up to the kill point) and let the
625
+ // work item be re-discovered on the next tick if still pending.
626
+ log('warn', `Steering resume for ${agentId} exited with code ${resumeCode} — completing dispatch without error`);
627
+ activeProcesses.delete(id);
628
+ completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering resume failed but original work completed', '', { processWorkItemFailure: false });
629
+ return;
630
+ }
631
+ // Successful resume — run normal close handler
632
+ onAgentClose(resumeCode);
633
+ });
622
634
  resumeProc.on('error', (err) => {
623
- log('error', `Steering re-spawn failed for ${agentId}: ${err.message}`);
635
+ log('warn', `Steering re-spawn error for ${agentId}: ${err.message}`);
624
636
  activeProcesses.delete(id);
625
- completeDispatch(id, DISPATCH_RESULT.ERROR, `Steering re-spawn error: ${err.message}`);
637
+ completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering re-spawn error but original work completed', '', { processWorkItemFailure: false });
626
638
  });
627
639
 
628
640
  // Don't run completion hooks — agent is still working
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.457",
3
+ "version": "0.1.459",
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"