From 5c806a4bd776ebd6caa147355012a202a8d7f896 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 14 Aug 2026 19:16:57 -0700 Subject: [PATCH] fix(stealth): handoff() uses the shared profile resolution + lock cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The headless-to-headed handoff path hardcoded ~/.gstack/chromium-profile, silently ignoring $CHROMIUM_PROFILE and $GSTACK_HOME (gbrowser's gbd sets per-workspace profiles), and skipped cleanSingletonLocks() — so a handoff into a profile with a stale SingletonLock could hang where launchHeaded() would have recovered. This was the third live drift between the three Chromium launch paths; the first two are documented in comments as shipped stealth regressions. Minimal targeted fix — the full buildLaunchConfig() extraction stays in the deferred queue. Co-Authored-By: Claude Fable 5 --- browse/src/browser-manager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index 130296935..f8aa4fe43 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -1568,8 +1568,13 @@ export class BrowserManager { console.log('[browse] Handoff: extension not found — headed mode without side panel'); } - const userDataDir = path.join(process.env.HOME || '/tmp', '.gstack', 'chromium-profile'); + // Same profile resolution + singleton-lock cleanup as launchHeaded(). + // This path previously hardcoded ~/.gstack/chromium-profile, silently + // ignoring $CHROMIUM_PROFILE / $GSTACK_HOME and skipping the lock + // cleanup — the third shipped drift between the three launch paths. + const userDataDir = resolveChromiumProfile(); fs.mkdirSync(userDataDir, { recursive: true }); + cleanSingletonLocks(userDataDir); // T1: same automation-tell-stripping defaults as launchHeaded(). // The handoff path (headless → headed re-launch) takes the same