@yemi33/minions 0.1.335 → 0.1.336

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,8 +1,9 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.335 (2026-04-03)
3
+ ## 0.1.336 (2026-04-03)
4
4
 
5
5
  ### Fixes
6
+ - CC session auto-invalidated when system prompt changes after restart
6
7
  - clear stale buildStatus when PRs are merged or abandoned
7
8
 
8
9
  ## 0.1.334 (2026-04-03)
package/dashboard.js CHANGED
@@ -277,8 +277,17 @@ let ccInFlight = false;
277
277
  let ccInFlightSince = 0; // timestamp — auto-release stuck guard
278
278
  const CC_INFLIGHT_TIMEOUT_MS = 2 * 60 * 1000; // 2 minutes — auto-release if request hangs
279
279
 
280
+ // Hash the system prompt so we can detect changes and invalidate stale sessions
281
+ const _ccPromptHash = require('crypto').createHash('md5').update(CC_STATIC_SYSTEM_PROMPT).digest('hex').slice(0, 8);
282
+
280
283
  function ccSessionValid() {
281
284
  if (!ccSession.sessionId) return false;
285
+ // Invalidate session if system prompt changed (e.g. after code update + restart)
286
+ if (ccSession._promptHash && ccSession._promptHash !== _ccPromptHash) {
287
+ console.log('[CC] System prompt changed — invalidating stale session');
288
+ ccSession = { sessionId: null, createdAt: null, lastActiveAt: null, turnCount: 0 };
289
+ return false;
290
+ }
282
291
  const age = Date.now() - new Date(ccSession.lastActiveAt || 0).getTime();
283
292
  return age < CC_SESSION_EXPIRY_MS && ccSession.turnCount < CC_SESSION_MAX_TURNS;
284
293
  }
@@ -553,6 +562,7 @@ function updateSession(store, key, sessionId, existing) {
553
562
  createdAt: existing ? ccSession.createdAt : now,
554
563
  lastActiveAt: now,
555
564
  turnCount: (existing ? ccSession.turnCount : 0) + 1,
565
+ _promptHash: _ccPromptHash,
556
566
  };
557
567
  safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
558
568
  } else if (key) {
@@ -3052,7 +3062,7 @@ What would you like to discuss or change? When you're happy, say "approve" and I
3052
3062
  // Update session
3053
3063
  const now = Date.now();
3054
3064
  if (result.sessionId) {
3055
- ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1 };
3065
+ ccSession = { sessionId: result.sessionId, createdAt: ccSession.createdAt || now, lastActiveAt: now, turnCount: (ccSession.turnCount || 0) + 1, _promptHash: _ccPromptHash };
3056
3066
  safeWrite(path.join(ENGINE_DIR, 'cc-session.json'), ccSession);
3057
3067
  }
3058
3068
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.335",
3
+ "version": "0.1.336",
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"