@yemi33/minions 0.1.310 → 0.1.311

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/engine.js +22 -14
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,10 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.310 (2026-04-03)
3
+ ## 0.1.311 (2026-04-03)
4
4
 
5
5
  ### Fixes
6
6
  - wrap all tickInner phases in try-catch for resilient dispatch
7
7
 
8
+ ### Other
9
+ - refactor: simplify tick resilience — safe() helper, per-spawn catch, discovery guard
10
+
8
11
  ## 0.1.309 (2026-04-03)
9
12
 
10
13
  ### Fixes
package/engine.js CHANGED
@@ -2182,16 +2182,16 @@ async function tickInner() {
2182
2182
  const config = getConfig();
2183
2183
  tickCount++;
2184
2184
 
2185
+ // Helper: run a phase, log + continue on error
2186
+ const safe = (label, fn) => { try { fn(); } catch (e) { log('warn', `${label}: ${e.message}`); } };
2187
+
2185
2188
  // 1. Check for timed-out agents, steering messages, and idle threshold
2186
- try { checkTimeouts(config); } catch (e) { log('warn', 'checkTimeouts: ' + e.message); }
2187
- try { checkSteering(config); } catch (e) { log('warn', 'checkSteering: ' + e.message); }
2188
- try { checkIdleThreshold(config); } catch (e) { log('warn', 'checkIdleThreshold: ' + e.message); }
2189
+ safe('checkTimeouts', () => checkTimeouts(config));
2190
+ safe('checkSteering', () => checkSteering(config));
2191
+ safe('checkIdleThreshold', () => checkIdleThreshold(config));
2189
2192
 
2190
2193
  // 1b. Check for meeting round timeouts
2191
- try {
2192
- const { checkMeetingTimeouts } = require('./engine/meeting');
2193
- checkMeetingTimeouts(config);
2194
- } catch (e) { log('warn', 'check meeting timeouts: ' + e.message); }
2194
+ safe('meetingTimeouts', () => { const { checkMeetingTimeouts } = require('./engine/meeting'); checkMeetingTimeouts(config); });
2195
2195
 
2196
2196
  // In stopping state, only track agent completions — skip discovery and dispatch
2197
2197
  if (control.state === 'stopping') {
@@ -2200,11 +2200,11 @@ async function tickInner() {
2200
2200
  }
2201
2201
 
2202
2202
  // 2. Consolidate inbox
2203
- try { consolidateInbox(config); } catch (e) { log('warn', 'consolidateInbox: ' + e.message); }
2203
+ safe('consolidateInbox', () => consolidateInbox(config));
2204
2204
 
2205
2205
  // 2.5. Periodic cleanup + MCP sync (every 10 ticks = ~5 minutes)
2206
2206
  if (tickCount % 10 === 0) {
2207
- try { runCleanup(config); } catch (e) { log('warn', 'runCleanup: ' + e.message); }
2207
+ safe('runCleanup', () => runCleanup(config));
2208
2208
  }
2209
2209
 
2210
2210
  // 2.6. Poll PR status: build, review, merge (every 6 ticks = ~3 minutes)
@@ -2335,13 +2335,18 @@ async function tickInner() {
2335
2335
  }
2336
2336
 
2337
2337
  // 3. Discover new work from sources
2338
- try { discoverWork(config); } catch (e) { log('warn', 'discoverWork: ' + e.message); }
2338
+ let discoveryOk = true;
2339
+ try { discoverWork(config); } catch (e) { log('warn', 'discoverWork: ' + e.message); discoveryOk = false; }
2339
2340
 
2340
2341
  // 4. Update snapshot
2341
- try { updateSnapshot(config); } catch (e) { log('warn', 'updateSnapshot: ' + e.message); }
2342
+ safe('updateSnapshot', () => updateSnapshot(config));
2343
+
2344
+ if (!discoveryOk) {
2345
+ log('warn', 'Skipping dispatch — discovery failed, stale data risk');
2346
+ return;
2347
+ }
2342
2348
 
2343
2349
  // 5. Process pending dispatches — auto-spawn agents
2344
- try {
2345
2350
  const dispatch = getDispatch();
2346
2351
  const activeCount = (dispatch.active || []).length;
2347
2352
  const maxConcurrent = config.engine?.maxConcurrent || 5;
@@ -2392,7 +2397,11 @@ async function tickInner() {
2392
2397
  const dispatched = new Set();
2393
2398
  for (const item of toDispatch) {
2394
2399
  if (!dispatched.has(item.id)) {
2395
- const proc = spawnAgent(item, config);
2400
+ let proc;
2401
+ try { proc = spawnAgent(item, config); } catch (spawnErr) {
2402
+ log('error', `spawnAgent exception for ${item.id}: ${spawnErr.message}`);
2403
+ proc = null;
2404
+ }
2396
2405
  if (proc === null) {
2397
2406
  // spawnAgent failed (e.g., worktree creation error). It already called
2398
2407
  // completeDispatch internally which handles retry logic, but log at the
@@ -2449,7 +2458,6 @@ async function tickInner() {
2449
2458
  if (skipReasonChanged) {
2450
2459
  mutateDispatch((dp) => { dp.pending = postDispatch.pending; return dp; });
2451
2460
  }
2452
- } catch (e) { log('warn', 'dispatch: ' + e.message); }
2453
2461
  }
2454
2462
 
2455
2463
  // ─── Exports (for engine/cli.js and other modules) ──────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.310",
3
+ "version": "0.1.311",
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"