@yemi33/minions 0.1.1718 → 0.1.1719

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,10 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1718 (2026-05-04)
3
+ ## 0.1.1719 (2026-05-04)
4
4
 
5
5
  ### Features
6
+ - fix stale Claude caps native inference (#2063)
6
7
  - prevent deferred steering crash (#2060)
7
8
 
9
+ ### Fixes
10
+ - filter agent failure classification (#2064)
11
+
8
12
  ## 0.1.1716 (2026-05-04)
9
13
 
10
14
  ### Features
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-04T23:02:50.359Z"
4
+ "cachedAt": "2026-05-04T23:03:44.791Z"
5
5
  }
@@ -50,6 +50,11 @@ function _safeWriteJson(p, obj) {
50
50
  try { fs.writeFileSync(p, JSON.stringify(obj, null, 2)); } catch { /* best effort */ }
51
51
  }
52
52
 
53
+ function _inferClaudeNativeFromBin(claudeBin) {
54
+ const ext = path.extname(claudeBin).toLowerCase();
55
+ return isWin ? ext === '.exe' : ext !== '.js';
56
+ }
57
+
53
58
  function _probeClaudePackage(pkgDir) {
54
59
  const nativeBin = path.join(pkgDir, 'bin', isWin ? 'claude.exe' : 'claude');
55
60
  if (fs.existsSync(nativeBin)) return { bin: nativeBin, native: true };
@@ -89,7 +94,14 @@ function resolveBinary({ env = process.env, config = null } = {}) {
89
94
  // 1. Cache hit — fastest path
90
95
  const cached = _safeJson(CAPS_FILE);
91
96
  if (cached?.claudeBin && fs.existsSync(cached.claudeBin)) {
92
- return { bin: cached.claudeBin, native: !!cached.claudeIsNative, leadingArgs: [] };
97
+ const native = cached.claudeIsNative != null
98
+ ? !!cached.claudeIsNative
99
+ : _inferClaudeNativeFromBin(cached.claudeBin);
100
+ if (cached.claudeIsNative == null) {
101
+ cached.claudeIsNative = native;
102
+ _safeWriteJson(CAPS_FILE, cached);
103
+ }
104
+ return { bin: cached.claudeBin, native, leadingArgs: [] };
93
105
  }
94
106
 
95
107
  // 2. PATH lookup → probe the resolved path's neighbouring node_modules dir
package/engine.js CHANGED
@@ -271,17 +271,72 @@ function _runtimeLogger() {
271
271
  };
272
272
  }
273
273
 
274
+ function _collectAgentFailureSignal(rawOutput) {
275
+ const text = rawOutput == null ? '' : String(rawOutput);
276
+ if (!text) return '';
277
+
278
+ const signals = [];
279
+ let sawJsonLine = false;
280
+ for (const rawLine of text.split('\n')) {
281
+ const line = rawLine.trim();
282
+ if (!line) continue;
283
+ if (!line.startsWith('{')) {
284
+ signals.push(line);
285
+ continue;
286
+ }
287
+ let obj;
288
+ try { obj = JSON.parse(line); } catch { continue; }
289
+ if (!obj || typeof obj !== 'object') continue;
290
+ sawJsonLine = true;
291
+
292
+ const type = String(obj.type || '');
293
+ const subtype = String(obj.subtype || '');
294
+ const eventType = String(obj.event?.type || '');
295
+ const isErrorEvent = type === 'error'
296
+ || eventType === 'error'
297
+ || subtype.startsWith('error')
298
+ || obj.is_error === true
299
+ || obj.error != null;
300
+ if (!isErrorEvent) continue;
301
+
302
+ for (const value of [
303
+ subtype,
304
+ obj.error,
305
+ obj.message,
306
+ obj.stderr,
307
+ obj.result,
308
+ obj.event?.error,
309
+ obj.event?.message,
310
+ ]) {
311
+ if (typeof value === 'string' && value.trim()) signals.push(value.trim());
312
+ }
313
+ }
314
+
315
+ if (signals.length > 0) return signals.join('\n');
316
+ return sawJsonLine ? '' : text;
317
+ }
318
+
319
+ function _stdoutForFallbackClassification(rawStdout, failureSignal) {
320
+ if (failureSignal) return failureSignal;
321
+ const text = rawStdout == null ? '' : String(rawStdout);
322
+ if (!text.trim()) return '';
323
+ return 'agent produced non-empty stdout without a terminal runtime error signal';
324
+ }
325
+
274
326
  function _classifyAgentFailure(runtime, code, stdout, stderr) {
327
+ const failureSignal = _collectAgentFailureSignal(stdout);
328
+ const fallbackStdout = _stdoutForFallbackClassification(stdout, failureSignal);
275
329
  if (runtime && typeof runtime.classifyFailure === 'function') {
276
330
  const classified = runtime.classifyFailure({
277
331
  code,
278
- stdout,
332
+ stdout: failureSignal,
279
333
  stderr,
280
- fallback: classifyFailureFallback,
334
+ fallback: (fallbackCode, _stdout, fallbackStderr) =>
335
+ classifyFailureFallback(fallbackCode, fallbackStdout, fallbackStderr),
281
336
  });
282
337
  if (classified && classified.failureClass) return classified;
283
338
  }
284
- return { failureClass: classifyFailureFallback(code, stdout, stderr) };
339
+ return { failureClass: classifyFailureFallback(code, fallbackStdout, stderr) };
285
340
  }
286
341
 
287
342
  function ackPendingSteeringFiles(agentId, procInfo, rawOutput, observedAtMs = Date.now()) {
@@ -4409,7 +4464,7 @@ module.exports = {
4409
4464
  reconcileItemsWithPrs, detectDependencyCycles,
4410
4465
  parseConflictFiles, pruneAncestorDeps, preflightMergeSimulation, // exported for testing
4411
4466
  isWorktreeRetryableError, removeStaleIndexLock, // exported for testing
4412
- _maxTurnsForType, buildProjectContext, normalizeAc, _buildAgentSpawnFlags, // exported for testing
4467
+ _maxTurnsForType, buildProjectContext, normalizeAc, _buildAgentSpawnFlags, _classifyAgentFailure, // exported for testing
4413
4468
 
4414
4469
  // Playbooks
4415
4470
  renderPlaybook, validatePlaybookVars, PLAYBOOK_REQUIRED_VARS, buildWorkItemDispatchVars,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1718",
3
+ "version": "0.1.1719",
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"