@yemi33/minions 0.1.499 → 0.1.500

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,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.499 (2026-04-07)
3
+ ## 0.1.500 (2026-04-07)
4
4
 
5
5
  ### Features
6
6
  - strengthen CC dispatch contract with domain terminology mapping
7
7
 
8
+ ### Fixes
9
+ - comprehensive steering failure handling with user-visible feedback
10
+
8
11
  ## 0.1.498 (2026-04-07)
9
12
 
10
13
  ### Features
package/engine.js CHANGED
@@ -576,12 +576,27 @@ function spawnAgent(dispatchItem, config) {
576
576
  delete procInfo._steeringMessage;
577
577
  delete procInfo._steeringSessionId;
578
578
 
579
+ // Guard: can't resume without a session
580
+ if (!steerSessionId) {
581
+ log('warn', `Steering: no sessionId for ${agentId} — appending message to live output only`);
582
+ try { fs.appendFileSync(liveOutputPath, `\n[steering-failed] No session to resume. Message was: ${steerMsg}\n`); } catch {}
583
+ activeProcesses.delete(id);
584
+ completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering skipped (no session)', '', { processWorkItemFailure: false });
585
+ return;
586
+ }
587
+
579
588
  log('info', `Steering: re-spawning ${agentId} with --resume ${steerSessionId}`);
580
589
 
581
590
  // Write new prompt with steering message
582
591
  const steerPrompt = `Message from your human teammate:\n\n${steerMsg}\n\nRespond to this, then continue working on your current task.`;
583
592
  const steerPromptPath = path.join(ENGINE_DIR, 'tmp', `prompt-steer-${safeId}.md`);
584
- safeWrite(steerPromptPath, steerPrompt);
593
+ try { safeWrite(steerPromptPath, steerPrompt); } catch (e) {
594
+ log('warn', `Steering: failed to write prompt for ${agentId}: ${e.message}`);
595
+ try { fs.appendFileSync(liveOutputPath, `\n[steering-failed] Could not write prompt. Message was: ${steerMsg}\n`); } catch {}
596
+ activeProcesses.delete(id);
597
+ completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering prompt write failed', '', { processWorkItemFailure: false });
598
+ return;
599
+ }
585
600
 
586
601
  // Build resume args
587
602
  const resumeArgs = [
@@ -595,11 +610,21 @@ function spawnAgent(dispatchItem, config) {
595
610
 
596
611
  const spawnScript = path.join(ENGINE_DIR, 'spawn-agent.js');
597
612
  const childEnv = shared.cleanChildEnv();
598
- const resumeProc = runFile(process.execPath, [spawnScript, steerPromptPath, steerPromptPath, ...resumeArgs], {
599
- cwd,
600
- stdio: ['pipe', 'pipe', 'pipe'],
601
- env: childEnv,
602
- });
613
+ let resumeProc;
614
+ try {
615
+ resumeProc = runFile(process.execPath, [spawnScript, steerPromptPath, steerPromptPath, ...resumeArgs], {
616
+ cwd,
617
+ stdio: ['pipe', 'pipe', 'pipe'],
618
+ env: childEnv,
619
+ });
620
+ } catch (e) {
621
+ log('warn', `Steering: spawn failed for ${agentId}: ${e.message}`);
622
+ try { fs.appendFileSync(liveOutputPath, `\n[steering-failed] Spawn error: ${e.message}. Message was: ${steerMsg}\n`); } catch {}
623
+ try { fs.unlinkSync(steerPromptPath); } catch {}
624
+ activeProcesses.delete(id);
625
+ completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering spawn failed', '', { processWorkItemFailure: false });
626
+ return;
627
+ }
603
628
 
604
629
  // Re-attach to existing tracking
605
630
  activeProcesses.set(id, { proc: resumeProc, agentId, startedAt: procInfo.startedAt, sessionId: steerSessionId, _steeringAt: Date.now() });
@@ -635,6 +660,7 @@ function spawnAgent(dispatchItem, config) {
635
660
  try { fs.unlinkSync(steerPromptPath); } catch { /* cleanup */ }
636
661
  if (resumeCode !== 0) {
637
662
  log('warn', `Steering resume for ${agentId} exited with code ${resumeCode} | stderr: ${stderr.slice(-300).replace(/\n/g, ' ')}`);
663
+ try { fs.appendFileSync(liveOutputPath, `\n[steering-failed] Resume exited with code ${resumeCode}. Your message was received but the agent could not continue the session.\n`); } catch {}
638
664
  activeProcesses.delete(id);
639
665
  completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering resume failed but original work completed', '', { processWorkItemFailure: false });
640
666
  return;
@@ -644,6 +670,7 @@ function spawnAgent(dispatchItem, config) {
644
670
  });
645
671
  resumeProc.on('error', (err) => {
646
672
  log('warn', `Steering re-spawn error for ${agentId}: ${err.message}`);
673
+ try { fs.appendFileSync(liveOutputPath, `\n[steering-failed] Spawn error: ${err.message}. Your message was received but the agent could not resume.\n`); } catch {}
647
674
  activeProcesses.delete(id);
648
675
  completeDispatch(id, DISPATCH_RESULT.SUCCESS, 'Steering re-spawn error but original work completed', '', { processWorkItemFailure: false });
649
676
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.499",
3
+ "version": "0.1.500",
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"