@yemi33/minions 0.1.409 → 0.1.410
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 +5 -0
- package/engine/cli.js +9 -3
- package/engine/timeout.js +13 -5
- package/engine.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/engine/cli.js
CHANGED
|
@@ -149,8 +149,8 @@ const commands = {
|
|
|
149
149
|
if (agentPid && agentPid > 0) {
|
|
150
150
|
try {
|
|
151
151
|
if (process.platform === 'win32') {
|
|
152
|
-
const out = exec(`tasklist /FI "PID eq ${agentPid}" /NH`, { encoding: 'utf8', timeout: 3000 });
|
|
153
|
-
if (!
|
|
152
|
+
const out = exec(`tasklist /FI "PID eq ${agentPid}" /NH`, { encoding: 'utf8', timeout: 3000 }).trim();
|
|
153
|
+
if (!new RegExp(`\\b${agentPid}\\b`).test(out)) agentPid = null;
|
|
154
154
|
} else {
|
|
155
155
|
process.kill(agentPid, 0);
|
|
156
156
|
}
|
|
@@ -158,7 +158,13 @@ const commands = {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
if (agentPid) {
|
|
161
|
-
|
|
161
|
+
// Load sessionId from session.json for steering support
|
|
162
|
+
let sessionId = null;
|
|
163
|
+
try {
|
|
164
|
+
const sj = safeJson(path.join(AGENTS_DIR, agentId, 'session.json'));
|
|
165
|
+
if (sj?.sessionId) sessionId = sj.sessionId;
|
|
166
|
+
} catch {}
|
|
167
|
+
e.activeProcesses.set(item.id, { proc: { pid: agentPid > 0 ? agentPid : null }, agentId, startedAt: item.created_at, reattached: true, sessionId });
|
|
162
168
|
// Sync work item status to dispatched — direct file write to avoid lifecycle lazy init issues
|
|
163
169
|
if (item.meta?.item?.id && item.meta?.project?.localPath) {
|
|
164
170
|
try {
|
package/engine/timeout.js
CHANGED
|
@@ -60,16 +60,24 @@ function checkSteering(config) {
|
|
|
60
60
|
const steerPath = path.join(AGENTS_DIR, info.agentId, 'steer.md');
|
|
61
61
|
if (!fs.existsSync(steerPath)) continue;
|
|
62
62
|
|
|
63
|
-
const message = safeRead(steerPath);
|
|
64
|
-
try { fs.unlinkSync(steerPath); } catch { /* cleanup */ }
|
|
65
|
-
if (!message) continue;
|
|
66
|
-
|
|
67
63
|
const sessionId = info.sessionId;
|
|
68
64
|
if (!sessionId) {
|
|
69
|
-
|
|
65
|
+
// No sessionId yet — check stale (>5 min means it'll never arrive)
|
|
66
|
+
try {
|
|
67
|
+
const age = Date.now() - fs.statSync(steerPath).mtimeMs;
|
|
68
|
+
if (age > 300000) {
|
|
69
|
+
log('warn', `Steering: no sessionId for ${info.agentId} after 5m — deleting stale message`);
|
|
70
|
+
try { fs.unlinkSync(steerPath); } catch {}
|
|
71
|
+
}
|
|
72
|
+
} catch {}
|
|
73
|
+
// Leave steer.md in place — retry next tick when sessionId may be available
|
|
70
74
|
continue;
|
|
71
75
|
}
|
|
72
76
|
|
|
77
|
+
const message = safeRead(steerPath);
|
|
78
|
+
try { fs.unlinkSync(steerPath); } catch { /* cleanup */ }
|
|
79
|
+
if (!message) continue;
|
|
80
|
+
|
|
73
81
|
log('info', `Steering: killing ${info.agentId} (${id}) for session resume with human message`);
|
|
74
82
|
|
|
75
83
|
// Kill current process
|
package/engine.js
CHANGED
|
@@ -696,7 +696,13 @@ function spawnAgent(dispatchItem, config) {
|
|
|
696
696
|
}, 3000);
|
|
697
697
|
|
|
698
698
|
// Track process — even if PID isn't available yet (async on Windows)
|
|
699
|
-
|
|
699
|
+
// Pre-load sessionId from session.json so steering works immediately on resume
|
|
700
|
+
let initialSessionId = null;
|
|
701
|
+
try {
|
|
702
|
+
const sj = safeJson(path.join(AGENTS_DIR, agentId, 'session.json'));
|
|
703
|
+
if (sj?.sessionId && sj.dispatchId === id) initialSessionId = sj.sessionId;
|
|
704
|
+
} catch {}
|
|
705
|
+
activeProcesses.set(id, { proc, agentId, startedAt, sessionId: initialSessionId });
|
|
700
706
|
|
|
701
707
|
// Log PID and persist to registry
|
|
702
708
|
if (proc.pid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.410",
|
|
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"
|