Skip to content

fix(agent): start and clean up the CDP browser host on Windows#199

Open
luminary19 wants to merge 3 commits into
sybil-solutions:mainfrom
luminary19:up/browser-host
Open

fix(agent): start and clean up the CDP browser host on Windows#199
luminary19 wants to merge 3 commits into
sybil-solutions:mainfrom
luminary19:up/browser-host

Conversation

@luminary19

Copy link
Copy Markdown
Contributor

Summary

The browser host never came up on Windows: port enumeration used POSIX
tooling, the DevTools ws endpoint was read only from Chrome's stderr (empty
when Windows de-elevates the browser out of an elevated parent), and orphaned
profile browsers from crashed hosts blocked relaunch (pkill cleanup is
POSIX-only). Adds netstat -ano enumeration, falls back to the profile's
DevToolsActivePort file for the endpoint, and sweeps/revalidates orphaned
profile browsers before launch. Fixes #198.

Validation

npm --prefix frontend run typecheck clean (covers the agent-runtime sources);
check:quality runs as the pre-push gate. The Windows behavior — netstat -ano
port enumeration, DevToolsActivePort endpoint fallback, orphan-profile sweep —
was verified live on Windows 11 (embedded browser navigates/snapshots from
/agent; killing the host mid-session and relaunching recovers). Linux/macOS is
unchanged: the stderr endpoint path runs first and short-circuits, and cleanup
keeps its existing behavior.

UI changes

None.

Risks / rollout notes

  • The orphan sweep only targets processes whose command line references the
    dedicated local-studio-browser-profile dir — it cannot touch user
    browsers.

@luminary19
luminary19 requested a review from 0xSero as a code owner July 13, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Embedded browser host cannot start on Windows — port discovery and DevTools handshake are POSIX-only

1 participant