@yemi33/minions 0.1.23 → 0.1.25

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.25 (2026-03-28)
4
+
5
+ ### Engine
6
+ - engine.js
7
+ - engine/lifecycle.js
8
+
9
+ ### Other
10
+ - test/unit.test.js
11
+
12
+ ## 0.1.24 (2026-03-28)
13
+
14
+ ### Engine
15
+ - engine.js
16
+
3
17
  ## 0.1.23 (2026-03-28)
4
18
 
5
19
  ### Other
@@ -1011,7 +1011,8 @@ function runPostCompletionHooks(dispatchItem, agentId, code, stdout, config) {
1011
1011
  if (isSuccess && sessionId && agentId && !agentId.startsWith('temp-')) {
1012
1012
  try {
1013
1013
  shared.safeWrite(path.join(AGENTS_DIR, agentId, 'session.json'), {
1014
- sessionId, dispatchId: dispatchItem.id, savedAt: new Date().toISOString()
1014
+ sessionId, dispatchId: dispatchItem.id, savedAt: new Date().toISOString(),
1015
+ branch: dispatchItem.meta?.branch || null,
1015
1016
  });
1016
1017
  } catch {}
1017
1018
  }
package/engine.js CHANGED
@@ -939,15 +939,18 @@ function spawnAgent(dispatchItem, config) {
939
939
  args.push('--allowedTools', claudeConfig.allowedTools);
940
940
  }
941
941
 
942
- // Session resume: reuse last session if recent enough (< 2 hours)
942
+ // Session resume: reuse last session if same branch and recent enough (< 2 hours)
943
+ // Only resume when the context is relevant — same branch means the agent is
944
+ // continuing work on the same PR/feature (e.g., author fixing their own build failure)
943
945
  if (!agentId.startsWith('temp-')) {
944
946
  try {
945
947
  const sessionFile = safeJson(path.join(AGENTS_DIR, agentId, 'session.json'));
946
948
  if (sessionFile?.sessionId && sessionFile.savedAt) {
947
949
  const sessionAge = Date.now() - new Date(sessionFile.savedAt).getTime();
948
- if (sessionAge < 2 * 60 * 60 * 1000) { // 2 hour TTL
950
+ const sameBranch = branchName && sessionFile.branch && sessionFile.branch === branchName;
951
+ if (sessionAge < 2 * 60 * 60 * 1000 && sameBranch) {
949
952
  args.push('--resume', sessionFile.sessionId);
950
- log('info', `Resuming session ${sessionFile.sessionId} for ${agentId} (age: ${Math.round(sessionAge / 60000)}min)`);
953
+ log('info', `Resuming session ${sessionFile.sessionId} for ${agentId} on branch ${branchName} (age: ${Math.round(sessionAge / 60000)}min)`);
951
954
  }
952
955
  }
953
956
  } catch {}
@@ -2522,11 +2525,11 @@ function discoverFromPrs(config, project) {
2522
2525
  if (item) { newWork.push(item); setCooldown(key); }
2523
2526
  }
2524
2527
 
2525
- // PRs with build failures — any agent can pick this up
2528
+ // PRs with build failures — route to author (has session context from implementing)
2526
2529
  if (pr.status === 'active' && pr.buildStatus === 'failing') {
2527
2530
  const key = `build-fix-${project?.name || 'default'}-${pr.id}`;
2528
2531
  if (isAlreadyDispatched(key) || isOnCooldown(key, cooldownMs)) continue;
2529
- const agentId = resolveAgent('fix', config);
2532
+ const agentId = resolveAgent('fix', config, pr.agent);
2530
2533
  if (!agentId) continue;
2531
2534
 
2532
2535
  const item = buildPrDispatch(agentId, config, project, pr, 'fix', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
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"