You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$B cookie-import-browser opens a picker UI served by the browse server, but the parent-PID watchdog kills that server shortly after the spawning CLI exits. Users interacting with the picker UI hit Failed to fetch on import.
Repro
$B cookie-import-browser — picker opens at http://127.0.0.1:<port>/cookie-picker.
Interact with the picker UI (scan domains, search, etc.).
Click + to import a domain.
UI shows Import failed for <domain>: Failed to fetch.
Root cause
Two patches landed close together and their interaction wasn't exercised:
cli.ts:229 always sets BROWSE_PARENT_PID = String(process.pid) — i.e., the CLI's own pid. The CLI exits as soon as cookie-import-browser returns the picker URL, so the next watchdog tick kills the server.
The picker UI's subsequent fetch() calls then fail. The 30-min IDLE_TIMEOUT_MS never gets a chance to apply.
The watchdog polls every 15s, so the kill fires 0–15s after the CLI exits. Any picker interaction past that point fails. Likely slipped past testing because a fast click-through (import the first domain in the initial list) can land before the first tick; real use (scanning domains, searching) gives it time to fire.
Proposed fix (by Claude Code)
Let the watchdog skip shutdown while the picker has unexpired codes or sessions. Two-file change:
browse/src/cookie-picker-routes.ts — export state check:
browse/src/server.ts — consult it in the watchdog:
}catch{if(hasActivePicker())return;console.log(`[browse] Parent process ${BROWSE_PARENT_PID} exited, shutting down`);shutdown();}
Bounded by the existing 1-hour SESSION_TTL_MS, so orphan risk on Windows stays small. Tested locally: server stays up for the picker flow, shuts down normally after session expiry.
Summary
$B cookie-import-browseropens a picker UI served by the browse server, but the parent-PID watchdog kills that server shortly after the spawning CLI exits. Users interacting with the picker UI hitFailed to fetchon import.Repro
$B cookie-import-browser— picker opens athttp://127.0.0.1:<port>/cookie-picker.+to import a domain.Import failed for <domain>: Failed to fetch.Root cause
Two patches landed close together and their interaction wasn't exercised:
browse/src/server.ts:753-768(commit03973c2f, fix: community security wave — 8 PRs, 4 contributors (v0.15.13.0) #847, v0.15.13.0). PollsBROWSE_PARENT_PIDevery 15s and callsshutdown()when the parent is gone.cli.ts:229always setsBROWSE_PARENT_PID = String(process.pid)— i.e., the CLI's own pid. The CLI exits as soon ascookie-import-browserreturns the picker URL, so the next watchdog tick kills the server.fetch()calls then fail. The 30-minIDLE_TIMEOUT_MSnever gets a chance to apply.The watchdog polls every 15s, so the kill fires 0–15s after the CLI exits. Any picker interaction past that point fails. Likely slipped past testing because a fast click-through (import the first domain in the initial list) can land before the first tick; real use (scanning domains, searching) gives it time to fire.
Proposed fix (by Claude Code)
Let the watchdog skip shutdown while the picker has unexpired codes or sessions. Two-file change:
browse/src/cookie-picker-routes.ts— export state check:browse/src/server.ts— consult it in the watchdog:Bounded by the existing 1-hour
SESSION_TTL_MS, so orphan risk on Windows stays small. Tested locally: server stays up for the picker flow, shuts down normally after session expiry.