multi-agents-cli 1.1.50 → 1.1.52

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.
@@ -1745,13 +1745,13 @@ ${excludedUrls}
1745
1745
  console.log('');
1746
1746
  console.log(' \x1b[7m What happens next \x1b[0m');
1747
1747
  console.log(' ┌─────────────────────────────────────────────────────────┐');
1748
- console.log(' │ → \x1b[1m' + (config.ide.name || 'Your IDE') + '\x1b[0m will open at your agent workspace');
1749
- console.log(' │ → A new terminal window will open with Claude Code');
1750
- console.log(' │');
1751
- console.log(' │ \x1b[1mOnce open:\x1b[0m');
1752
- console.log(' │ \x1b[1m2.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1753
- console.log(' │ \x1b[1m3.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1754
- console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1748
+ console.log(' │ → \x1b[1m' + (config.ide.name || 'Your IDE') + '\x1b[0m will open at your agent workspace');
1749
+ console.log(' │ → A new terminal window will open with Claude Code');
1750
+ console.log(' │');
1751
+ console.log(' │ \x1b[1mOnce open:\x1b[0m');
1752
+ console.log(' │ \x1b[1m2.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1753
+ console.log(' │ \x1b[1m3.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1754
+ console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1755
1755
  console.log(' └─────────────────────────────────────────────────────────┘');
1756
1756
  console.log('');
1757
1757
  const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
@@ -1770,13 +1770,13 @@ ${excludedUrls}
1770
1770
  console.log('');
1771
1771
  console.log(' \x1b[7m What happens next \x1b[0m');
1772
1772
  console.log(' ┌─────────────────────────────────────────────────────────┐');
1773
- console.log(' │ → \x1b[1m' + (config.ide.name || 'Your IDE') + '\x1b[0m will open at your agent workspace');
1774
- console.log(' │');
1775
- console.log(' │ \x1b[1mOnce open:\x1b[0m');
1776
- console.log(' │ \x1b[1m1.\x1b[0m Open a new Claude Code session inside the IDE');
1777
- console.log(' │ \x1b[1m3.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1778
- console.log(' │ \x1b[1m4.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1779
- console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1773
+ console.log(' │ → \x1b[1m' + (config.ide.name || 'Your IDE') + '\x1b[0m will open at your agent workspace');
1774
+ console.log(' │');
1775
+ console.log(' │ \x1b[1mOnce open:\x1b[0m');
1776
+ console.log(' │ \x1b[1m1.\x1b[0m Open a new Claude Code session inside the IDE');
1777
+ console.log(' │ \x1b[1m3.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1778
+ console.log(' │ \x1b[1m4.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1779
+ console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1780
1780
  console.log(' └─────────────────────────────────────────────────────────┘');
1781
1781
  console.log('');
1782
1782
  const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
@@ -1791,12 +1791,12 @@ ${excludedUrls}
1791
1791
  console.log('');
1792
1792
  console.log(' \x1b[7m What happens next \x1b[0m');
1793
1793
  console.log(' ┌─────────────────────────────────────────────────────────┐');
1794
- console.log(' │ → A new terminal window will open with Claude Code');
1795
- console.log(' │');
1796
- console.log(' │ \x1b[1mOnce open:\x1b[0m');
1797
- console.log(' │ \x1b[1m2.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1798
- console.log(' │ \x1b[1m3.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1799
- console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1794
+ console.log(' │ → A new terminal window will open with Claude Code');
1795
+ console.log(' │');
1796
+ console.log(' │ \x1b[1mOnce open:\x1b[0m');
1797
+ console.log(' │ \x1b[1m2.\x1b[0m Type anything \x1b[2m(e.g. go, start, begin)\x1b[0m');
1798
+ console.log(' │ \x1b[1m3.\x1b[0m Let the agent run — don\'t interrupt mid-task');
1799
+ console.log(' │ \x1b[1mThe agent\x1b[0m will run \x1b[36mnpm run complete\x1b[0m automatically');
1800
1800
  console.log(' └─────────────────────────────────────────────────────────┘');
1801
1801
  console.log('');
1802
1802
  const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
@@ -221,6 +221,51 @@ async function sync(opts = {}) {
221
221
  }
222
222
  });
223
223
 
224
+ // Check 3b staleness / stuck-push detection
225
+ const STALE_THRESHOLD_MS = 4 * 60 * 60 * 1000; // 4 hours - single constant, tune here
226
+ eachSlot(tracking, (scope, agent, slot) => {
227
+ if (!slot.branch) return;
228
+ if (!isActive(slot) && slot.status !== 'MISSING') return;
229
+ if (mergedBranches.includes(slot.branch)) return; // already handled by check 3
230
+
231
+ // Primary signal: TASK.md says [x] COMPLETED but branch not merged -> stalled push
232
+ const wt = worktrees.find(w => w.branch === slot.branch);
233
+ const wtPath = wt ? wt.path : slot.worktreePath;
234
+ if (wtPath && worktreeHealthy(wtPath)) {
235
+ const taskPath = findTaskMd(wtPath, scope);
236
+ if (taskPath) {
237
+ try {
238
+ const taskContent = fs.readFileSync(taskPath, 'utf8');
239
+ if (taskContent.includes('[x] COMPLETED')) {
240
+ decisions.push(
241
+ `${scope}/${agent}: TASK.md marked COMPLETED but branch not merged - push/merge likely failed. \n` +
242
+ ` Run: git push origin ${slot.branch} && npm run complete`
243
+ );
244
+ return;
245
+ }
246
+ } catch {}
247
+ }
248
+ }
249
+
250
+ // Secondary signal: no commits in > STALE_THRESHOLD_MS since launch (softer advisory)
251
+ if (slot.launchedAt) {
252
+ try {
253
+ const lastCommitTs = parseInt(
254
+ execSync(`git log -1 --format=%ct ${slot.branch}`, { cwd: ROOT, stdio: 'pipe', encoding: 'utf8' }).trim(),
255
+ 10
256
+ ) * 1000;
257
+ const launchedAt = new Date(slot.launchedAt).getTime();
258
+ const elapsed = Date.now() - Math.max(lastCommitTs, launchedAt);
259
+ if (elapsed > STALE_THRESHOLD_MS) {
260
+ const hours = Math.round(elapsed / 1000 / 60 / 60);
261
+ decisions.push(
262
+ `${scope}/${agent}: no new commits in ~${hours}h - may be stalled or still running, check manually`
263
+ );
264
+ }
265
+ } catch {}
266
+ }
267
+ });
268
+
224
269
  // Check 4 BUILD_STATE vs tracking drift
225
270
  eachSlot(tracking, (scope, agent, slot) => {
226
271
  if (slot.status !== 'COMPLETED' || !slot.branch) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.50",
3
+ "version": "1.1.52",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",