@yemi33/minions 0.1.470 → 0.1.472
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 +3 -1
- package/engine/timeout.js +4 -5
- package/engine.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.1.
|
|
3
|
+
## 0.1.472 (2026-04-07)
|
|
4
4
|
|
|
5
5
|
### Fixes
|
|
6
|
+
- steering audit — prevent double-kill, clean up temp files, fix leaks
|
|
7
|
+
- steering resume improvements — better error logging, heartbeat restart
|
|
6
8
|
- prevent slow work item modal on large descriptions
|
|
7
9
|
- only cache sessionId for steering when actually resuming same branch
|
|
8
10
|
|
package/engine/timeout.js
CHANGED
|
@@ -57,18 +57,19 @@ function checkIdleThreshold(config) {
|
|
|
57
57
|
function checkSteering(config) {
|
|
58
58
|
const activeProcesses = engine().activeProcesses;
|
|
59
59
|
for (const [id, info] of activeProcesses) {
|
|
60
|
+
// Skip if already being steered (prevents double-kill race)
|
|
61
|
+
if (info._steeringMessage || info._steeringAt) continue;
|
|
62
|
+
|
|
60
63
|
const steerPath = path.join(AGENTS_DIR, info.agentId, 'steer.md');
|
|
61
64
|
let steerMtime;
|
|
62
65
|
try { steerMtime = fs.statSync(steerPath).mtimeMs; } catch { continue; } // ENOENT = no steering message
|
|
63
66
|
|
|
64
67
|
const sessionId = info.sessionId;
|
|
65
68
|
if (!sessionId) {
|
|
66
|
-
// No sessionId yet — check stale (>5 min means it'll never arrive)
|
|
67
69
|
if (Date.now() - steerMtime > 300000) {
|
|
68
70
|
log('warn', `Steering: no sessionId for ${info.agentId} after 5m — deleting stale message`);
|
|
69
71
|
try { fs.unlinkSync(steerPath); } catch {}
|
|
70
72
|
}
|
|
71
|
-
// Leave steer.md in place — retry next tick when sessionId may be available
|
|
72
73
|
continue;
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -78,13 +79,11 @@ function checkSteering(config) {
|
|
|
78
79
|
|
|
79
80
|
log('info', `Steering: killing ${info.agentId} (${id}) for session resume with human message`);
|
|
80
81
|
|
|
81
|
-
// Kill current process
|
|
82
82
|
shared.killImmediate(info.proc);
|
|
83
83
|
|
|
84
|
-
// Store steering context for re-spawn on close
|
|
85
84
|
info._steeringMessage = message;
|
|
86
85
|
info._steeringSessionId = sessionId;
|
|
87
|
-
info._steeringAt = Date.now();
|
|
86
|
+
info._steeringAt = Date.now();
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
|
package/engine.js
CHANGED
|
@@ -602,13 +602,19 @@ function spawnAgent(dispatchItem, config) {
|
|
|
602
602
|
});
|
|
603
603
|
|
|
604
604
|
// Re-attach to existing tracking
|
|
605
|
-
activeProcesses.set(id, { proc: resumeProc, agentId, startedAt: procInfo.startedAt, sessionId: steerSessionId });
|
|
605
|
+
activeProcesses.set(id, { proc: resumeProc, agentId, startedAt: procInfo.startedAt, sessionId: steerSessionId, _steeringAt: Date.now() });
|
|
606
606
|
|
|
607
607
|
// Reset output buffers so post-completion parsing only sees the resumed session
|
|
608
608
|
stdout = '';
|
|
609
609
|
stderr = '';
|
|
610
610
|
lastOutputAt = Date.now();
|
|
611
611
|
|
|
612
|
+
// Restart heartbeat for the resumed process
|
|
613
|
+
if (heartbeatTimer) clearInterval(heartbeatTimer);
|
|
614
|
+
heartbeatTimer = setInterval(() => {
|
|
615
|
+
try { fs.appendFileSync(liveOutputPath, `\n[heartbeat] running — no output for ${Math.round((Date.now() - lastOutputAt) / 1000)}s\n`); } catch {}
|
|
616
|
+
}, 30000);
|
|
617
|
+
|
|
612
618
|
// Re-wire stdout/stderr handlers (same as original)
|
|
613
619
|
resumeProc.stdout.on('data', (data) => {
|
|
614
620
|
const chunk = data.toString();
|
|
@@ -625,11 +631,10 @@ function spawnAgent(dispatchItem, config) {
|
|
|
625
631
|
|
|
626
632
|
// Re-wire close handler for the resumed process
|
|
627
633
|
resumeProc.on('close', (resumeCode) => {
|
|
634
|
+
if (heartbeatTimer) { clearInterval(heartbeatTimer); heartbeatTimer = null; }
|
|
635
|
+
try { fs.unlinkSync(steerPromptPath); } catch { /* cleanup */ }
|
|
628
636
|
if (resumeCode !== 0) {
|
|
629
|
-
|
|
630
|
-
// (the original work was already done up to the kill point) and let the
|
|
631
|
-
// work item be re-discovered on the next tick if still pending.
|
|
632
|
-
log('warn', `Steering resume for ${agentId} exited with code ${resumeCode} — completing dispatch without error`);
|
|
637
|
+
log('warn', `Steering resume for ${agentId} exited with code ${resumeCode} | stderr: ${stderr.slice(-300).replace(/\n/g, ' ')}`);
|
|
633
638
|
activeProcesses.delete(id);
|
|
634
639
|
completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering resume failed but original work completed', '', { processWorkItemFailure: false });
|
|
635
640
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.472",
|
|
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"
|