tycono 0.3.26 → 0.3.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,6 +36,7 @@ interface SupervisorState {
36
36
  crashCount: number;
37
37
  maxCrashRetries: number;
38
38
  restartTimer: ReturnType<typeof setTimeout> | null;
39
+ cleanupTimer: ReturnType<typeof setTimeout> | null;
39
40
  pendingDirectives: PendingDirective[];
40
41
  pendingQuestions: PendingQuestion[];
41
42
  createdAt: string;
@@ -88,6 +89,7 @@ class SupervisorHeartbeat {
88
89
  crashCount: 0,
89
90
  maxCrashRetries: 10,
90
91
  restartTimer: null,
92
+ cleanupTimer: null,
91
93
  pendingDirectives: [],
92
94
  pendingQuestions: [],
93
95
  createdAt: new Date().toISOString(),
@@ -198,6 +200,7 @@ class SupervisorHeartbeat {
198
200
  crashCount: 0,
199
201
  maxCrashRetries: 10,
200
202
  restartTimer: null,
203
+ cleanupTimer: null,
201
204
  pendingDirectives: [],
202
205
  pendingQuestions: [],
203
206
  createdAt: ceoSession?.createdAt ?? new Date().toISOString(),
@@ -531,6 +534,12 @@ Do NOT dispatch anyone. Do NOT create new files. Just answer concisely.`;
531
534
 
532
535
  state.status = 'running';
533
536
 
537
+ // Cancel pending cleanup timer — wave is active again
538
+ if (state.cleanupTimer) {
539
+ clearTimeout(state.cleanupTimer);
540
+ state.cleanupTimer = null;
541
+ }
542
+
534
543
  try {
535
544
  const exec = executionManager.startExecution({
536
545
  type: 'assign', // assign = no supervisor tools (dispatch/watch/amend)
@@ -744,6 +753,12 @@ ${state.continuous ? `## Continuous Improvement Mode (ON)
744
753
  }
745
754
  state.status = 'running';
746
755
 
756
+ // Cancel pending cleanup timer — wave is active again
757
+ if (state.cleanupTimer) {
758
+ clearTimeout(state.cleanupTimer);
759
+ state.cleanupTimer = null;
760
+ }
761
+
747
762
  try {
748
763
  const exec = executionManager.startExecution({
749
764
  type: 'wave',
@@ -825,11 +840,15 @@ ${state.continuous ? `## Continuous Improvement Mode (ON)
825
840
 
826
841
  // Delayed cleanup: remove wave sessions from multiplexer + supervisor map
827
842
  // (delay allows SSE clients to receive final events)
828
- setTimeout(() => {
843
+ // Cancel previous cleanup timer if exists (new directive may restart wave)
844
+ if (state.cleanupTimer) clearTimeout(state.cleanupTimer);
845
+ state.cleanupTimer = setTimeout(() => {
846
+ state.cleanupTimer = null;
829
847
  waveMultiplexer.cleanupWave(state.waveId);
830
848
  this.supervisors.delete(state.waveId);
831
849
  console.log(`[Supervisor] Cleaned up wave ${state.waveId} from memory`);
832
- }, 60_000).unref(); // 1 minute after wave done
850
+ }, 60_000);
851
+ state.cleanupTimer.unref();
833
852
  }
834
853
  }
835
854