fix: memory leaks and error handling improvements

- execution-bridge: track and cleanup retry timers to prevent memory leaks
- model-selector: add exhaustive type check for ModelTier
- ralph-tracker: fix division by zero when summary.total is 0
- respawn-controller: remove event listeners on stop to prevent memory leaks
- screen-manager: use Promise.allSettled for better error handling in stats
- session-manager: use Promise.allSettled for stopAllSessions resilience

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-28 20:19:14 +01:00
co-authored by Claude Opus 4.5
parent e0a695fed7
commit 8fb8e6fa83
6 changed files with 55 additions and 10 deletions
+3
View File
@@ -1043,6 +1043,9 @@ export class RespawnController extends EventEmitter {
this.log('Stopping respawn controller');
this.aiChecker.cancel();
this.planChecker.cancel();
// Remove event listeners from checkers to prevent memory leaks
this.aiChecker.removeAllListeners();
this.planChecker.removeAllListeners();
this.clearTimers();
this.stopDetectionUpdates();
this.setState('stopped');