support consecutive --auto-connect commands (#786)

This commit is contained in:
Chris Tate
2026-03-14 13:43:38 -05:00
committed by GitHub
parent fbdae9b6ae
commit da45d00b2a
2 changed files with 12 additions and 7 deletions
+3 -3
View File
@@ -872,9 +872,9 @@ async fn handle_launch(cmd: &Value, state: &mut DaemonState) -> Result<Value, St
// Relaunch logic: check if we can reuse the existing connection
let needs_relaunch = if let Some(ref mgr) = state.browser {
let has_cdp_arg = cdp_url.is_some() || cdp_port.is_some();
let was_cdp = mgr.is_cdp_connection();
has_cdp_arg != was_cdp || !mgr.is_connection_alive().await
let is_external = cdp_url.is_some() || cdp_port.is_some() || auto_connect;
let was_external = mgr.is_cdp_connection();
is_external != was_external || !mgr.is_connection_alive().await
} else {
true
};