From 3b39a6af71d606013a451d4f036617ce55ba576c Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Thu, 5 Mar 2026 13:41:48 -0800 Subject: [PATCH] stop existing instance before starting a new one on planoai up --- cli/planoai/native_runner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/planoai/native_runner.py b/cli/planoai/native_runner.py index 27672c64..c5ccd6e7 100644 --- a/cli/planoai/native_runner.py +++ b/cli/planoai/native_runner.py @@ -161,6 +161,11 @@ def start_native(plano_config_file, env, foreground=False, with_tracing=False): """Start Envoy and brightstaff natively.""" from planoai.core import _get_gateway_ports + # Stop any existing instance first + if os.path.exists(NATIVE_PID_FILE): + log.info("Stopping existing Plano instance...") + stop_native() + envoy_path = ensure_envoy_binary() ensure_wasm_plugins() brightstaff_path = ensure_brightstaff_binary() @@ -350,7 +355,7 @@ def _kill_pid(pid): def stop_native(): """Stop natively-running Envoy and brightstaff processes.""" if not os.path.exists(NATIVE_PID_FILE): - print("No native Plano instance found (PID file missing).") + log.info("No native Plano instance found (PID file missing).") return with open(NATIVE_PID_FILE, "r") as f: