@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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.410 (2026-04-06)
4
+
5
+ ### Fixes
6
+ - steering messages retry instead of being silently dropped
7
+
3
8
  ## 0.1.409 (2026-04-06)
4
9
 
5
10
  ### Fixes
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 (!out.includes(String(agentPid))) agentPid = null;
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
- e.activeProcesses.set(item.id, { proc: { pid: agentPid > 0 ? agentPid : null }, agentId, startedAt: item.created_at, reattached: true });
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
- log('warn', `Steering: no sessionId for ${info.agentId} cannot resume. Message dropped.`);
65
+ // No sessionId yetcheck 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
- activeProcesses.set(id, { proc, agentId, startedAt });
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.409",
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"