wolverine-ai 3.7.0 ā 3.7.2
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 +1 -1
- package/src/core/runner.js +21 -1
- package/src/monitor/error-monitor.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolverine-ai",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts ā automatically.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
package/src/core/runner.js
CHANGED
|
@@ -260,6 +260,9 @@ class WolverineRunner {
|
|
|
260
260
|
|
|
261
261
|
restart() {
|
|
262
262
|
console.log(chalk.blue("\n š Restarting server..."));
|
|
263
|
+
// Reset config cache so restart picks up any settings.json changes
|
|
264
|
+
const { resetConfig } = require("./config");
|
|
265
|
+
resetConfig();
|
|
263
266
|
this.healthMonitor.stop();
|
|
264
267
|
this._clearStabilityTimer();
|
|
265
268
|
|
|
@@ -555,6 +558,7 @@ class WolverineRunner {
|
|
|
555
558
|
this._healInProgress = false;
|
|
556
559
|
this._healStatus = null;
|
|
557
560
|
this._spawn();
|
|
561
|
+
this._processPendingErrorHeal();
|
|
558
562
|
} else {
|
|
559
563
|
console.log(chalk.red(`\nšŗ Wolverine could not heal: ${result.explanation}`));
|
|
560
564
|
|
|
@@ -606,7 +610,13 @@ class WolverineRunner {
|
|
|
606
610
|
* Unlike crash healing, the server is still running ā we heal and restart.
|
|
607
611
|
*/
|
|
608
612
|
async _healFromError(routePath, errorDetails) {
|
|
609
|
-
if (this.
|
|
613
|
+
if (this._shuttingDown) return;
|
|
614
|
+
if (this._healInProgress) {
|
|
615
|
+
// Queue the error ā process after current heal finishes
|
|
616
|
+
this._pendingErrorHeal = { routePath, errorDetails };
|
|
617
|
+
console.log(chalk.yellow(` š Heal in progress ā queued IPC error on ${routePath} for after current heal`));
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
610
620
|
this._healInProgress = true;
|
|
611
621
|
|
|
612
622
|
console.log(chalk.yellow(`\nšŗ Wolverine healing caught error on ${routePath}...`));
|
|
@@ -690,6 +700,16 @@ class WolverineRunner {
|
|
|
690
700
|
}
|
|
691
701
|
}
|
|
692
702
|
|
|
703
|
+
_processPendingErrorHeal() {
|
|
704
|
+
if (this._pendingErrorHeal) {
|
|
705
|
+
const { routePath, errorDetails } = this._pendingErrorHeal;
|
|
706
|
+
this._pendingErrorHeal = null;
|
|
707
|
+
console.log(chalk.yellow(` š Processing queued IPC error on ${routePath}`));
|
|
708
|
+
// Small delay to let the new child process start
|
|
709
|
+
setTimeout(() => this._healFromError(routePath, errorDetails), 2000);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
693
713
|
_startStabilityTimer() {
|
|
694
714
|
this._clearStabilityTimer();
|
|
695
715
|
// Capture backup ID in closure ā prevents race where a new heal overwrites _lastBackupId
|