diff --git a/electron/gateway/manager.ts b/electron/gateway/manager.ts index e61172087..415274a6a 100644 --- a/electron/gateway/manager.ts +++ b/electron/gateway/manager.ts @@ -297,13 +297,11 @@ export class GatewayManager extends EventEmitter { process.kill(pid, 0); // Still alive — keep this.process so later cleanup can reach it } catch { - // Process is gone — safe to clear the handle and ownership flag + // Process is gone — safe to clear the handle this.process = null; - this.ownsProcess = false; } } else { this.process = null; - this.ownsProcess = false; } } }, diff --git a/electron/gateway/startup-orchestrator.ts b/electron/gateway/startup-orchestrator.ts index 4036a6efe..102618554 100644 --- a/electron/gateway/startup-orchestrator.ts +++ b/electron/gateway/startup-orchestrator.ts @@ -98,15 +98,14 @@ export async function runGatewayStartupSequence(hooks: StartupHooks): Promise { logger.warn('Failed to terminate owned process before retry:', err); }); } - await hooks.delay(1000); hooks.assertLifecycle('start/retry-pre-port-wait'); // Wait for port to become free before retrying (handles lingering processes). // Use a short-polling AbortController so that a superseding stop()/restart() @@ -123,12 +122,6 @@ export async function runGatewayStartupSequence(hooks: StartupHooks): Promise((resolve) => {