From 2868365faed3b5890ff2daa0e8ee23519211f2dc Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sun, 16 Nov 2025 11:01:39 +0000 Subject: [PATCH] Fix: Clean up health check interval in onShellExecutionComplete to prevent memory leak --- src/integrations/terminal/ServiceManager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/integrations/terminal/ServiceManager.ts b/src/integrations/terminal/ServiceManager.ts index 45fb576957..e411f57ae0 100644 --- a/src/integrations/terminal/ServiceManager.ts +++ b/src/integrations/terminal/ServiceManager.ts @@ -114,6 +114,13 @@ export class ServiceManager { // If stopping, status changes from stopping to stopped/failed // If unexpected exit, status changes from starting/ready/running to stopped/failed serviceHandle.status = details.exitCode === 0 ? "stopped" : "failed" + + // Clean up health check interval to prevent memory leak + if (serviceHandle.healthCheckIntervalId) { + clearInterval(serviceHandle.healthCheckIntervalId) + serviceHandle.healthCheckIntervalId = undefined + } + this.notifyStatusChange(serviceHandle) }, }