From d8f484eded15fdbe96449c84742e2124fb7dd19f Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Fri, 19 Jun 2026 14:32:49 +0900 Subject: [PATCH] fix(tabs): gate the about:blank cleanup to the relay only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit closed the leftover about:blank on ANY connection — but on a launched browser the initial about:blank is the browser's own first tab, not daemon scratch, so it must stay. Broke e2e_tab_ids_not_reused (launched). Gate the cleanup on agent_group().is_some() (relay only), where the about:blank is a tab WE created. e2e_tab_ids_not_reused passes; relay scratch-blank close intact. --- cli/src/native/browser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/native/browser.rs b/cli/src/native/browser.rs index e77e997..98afcf8 100644 --- a/cli/src/native/browser.rs +++ b/cli/src/native/browser.rs @@ -2073,8 +2073,10 @@ impl BrowserManager { // Close the daemon's leftover initial `about:blank` scratch tab once this // real tab exists, so the session's tab group isn't left showing a stray // blank page beside the work tab (every group otherwise carried one). Only - // when opening a real url, and only OWNED, still-blank tabs. - if target_url != "about:blank" { + // on the RELAY — there the about:blank is a tab WE created as scratch; on a + // launched browser the initial about:blank is the browser's own first tab, + // which we must not close. Only when opening a real url, OWNED, still-blank. + if target_url != "about:blank" && self.agent_group().is_some() { if let Some(new_tid) = self.pages.get(index).map(|p| p.target_id.clone()) { let blanks: Vec = self .pages