@yemi33/minions 0.1.2134 → 0.1.2136

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 (2) hide show
  1. package/engine.js +28 -25
  2. package/package.json +1 -1
package/engine.js CHANGED
@@ -7700,33 +7700,11 @@ async function tickInner() {
7700
7700
  } catch (err) { log('warn', `Stall detection error: ${err?.message || err}`); }
7701
7701
  }
7702
7702
 
7703
- // 3. Discover new work from sources
7704
- // Cap temp-agent creation at (maxConcurrent - activeCount) for this tick so
7705
- // temps count against maxConcurrent like named agents. Without this, a mass
7706
- // discovery pass (e.g. 20 PR build failures) would stamp a fresh temp agent
7707
- // onto every pending item regardless of concurrency cap, and those temps
7708
- // would spawn over subsequent ticks — overwhelming the OS and mass-orphaning
7709
- // the dispatches (#1209).
7710
- {
7711
- const dispatchPre = getDispatch();
7712
- const activeCountPre = (dispatchPre.active || []).length;
7713
- const maxC = resolveMaxConcurrent(config);
7714
- setTempBudget(Math.max(0, maxC - activeCountPre));
7715
- }
7716
7703
  try { pruneStalePrDispatches(config); } catch (e) { log('warn', 'prune stale PR dispatches: ' + e.message); }
7717
- let discoveryOk = true;
7718
- try { await discoverWork(config); } catch (e) { log('warn', 'discoverWork: ' + e.message); discoveryOk = false; }
7719
- if (_isTickStale(myGeneration)) return;
7720
-
7721
- // 4. Update snapshot
7722
- safe('updateSnapshot', () => updateSnapshot(config));
7723
-
7724
- if (!discoveryOk) {
7725
- log('warn', 'Skipping dispatch — discovery failed, stale data risk');
7726
- return;
7727
- }
7728
7704
 
7729
- // 5. Process pending dispatches auto-spawn agents
7705
+ // 3. Process pending dispatches before discovery. discoverWork() runs
7706
+ // pre-dispatch LLM validation for newly found work; a slow validator must not
7707
+ // starve runnable entries that are already durable in dispatch.pending.
7730
7708
  const dispatch = getDispatch();
7731
7709
  const activeCount = (dispatch.active || []).length;
7732
7710
  const maxConcurrent = resolveMaxConcurrent(config);
@@ -8017,6 +7995,31 @@ async function tickInner() {
8017
7995
  if (_isTickStale(myGeneration)) return;
8018
7996
  mutateDispatch((dp) => { dp.pending = postDispatch.pending; return dp; });
8019
7997
  }
7998
+
7999
+ // 4. Discover new work from sources. Newly discovered dispatches are eligible
8000
+ // for the next tick; existing pending work has already had its spawn chance.
8001
+ // Cap temp-agent creation at (maxConcurrent - activeCount) for this tick so
8002
+ // temps count against maxConcurrent like named agents. Without this, a mass
8003
+ // discovery pass (e.g. 20 PR build failures) would stamp a fresh temp agent
8004
+ // onto every pending item regardless of concurrency cap, and those temps
8005
+ // would spawn over subsequent ticks — overwhelming the OS and mass-orphaning
8006
+ // the dispatches (#1209).
8007
+ {
8008
+ const dispatchPre = getDispatch();
8009
+ const activeCountPre = (dispatchPre.active || []).length;
8010
+ const maxC = resolveMaxConcurrent(config);
8011
+ setTempBudget(Math.max(0, maxC - activeCountPre));
8012
+ }
8013
+ let discoveryOk = true;
8014
+ try { await discoverWork(config); } catch (e) { log('warn', 'discoverWork: ' + e.message); discoveryOk = false; }
8015
+ if (_isTickStale(myGeneration)) return;
8016
+
8017
+ // 5. Update snapshot
8018
+ safe('updateSnapshot', () => updateSnapshot(config));
8019
+
8020
+ if (!discoveryOk) {
8021
+ log('warn', 'Discovery failed after pending dispatch pass — new work may be stale until next tick');
8022
+ }
8020
8023
  }
8021
8024
 
8022
8025
  // ─── 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.2134",
3
+ "version": "0.1.2136",
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"