Skip to content

Windows: Rust native binary uses Unix sockets (.sock) instead of TCP, Node.js daemon crashes after first connection #398

@opita04

Description

@opita04

Description

�gent-browser v0.9.1 does not work on Windows due to two issues:

Bug 1: Rust native binary hardcodes Unix socket path

The CLI entry point (�in/agent-browser.js) spawns the native Rust binary (�gent-browser-win32-x64.exe). This binary always looks for a Unix domain socket at ~/.agent-browser/default.sock, which doesn't exist on Windows.

The Node.js daemon (dist/daemon.js) correctly detects Windows and uses TCP on localhost instead:

// daemon.js line 326-333
if (isWindows) {
    const port = getPortForSession(currentSession);
    const portFile = getPortFile();
    fs.writeFileSync(portFile, port.toString());
    server.listen(port, '127.0.0.1', () => {});
}

But the Rust binary doesn't read the .port file or attempt TCP connection — it only tries the .sock path.

Error output:

✗ Daemon failed to start (socket: C:\Users\<user>\.agent-browser\default.sock)

Bug 2: Node.js daemon crashes after first TCP connection

When starting the Node.js daemon directly via startDaemon(), it starts and listens on TCP correctly. However, it crashes (exit code 1) shortly after receiving the first client connection. No error message is produced — it just dies silently.

Steps to reproduce:

  1. Install on Windows:
    pm install -g agent-browser && agent-browser install
  2. Run: �gent-browser open https://example.com
  3. Observe: ✗ Daemon failed to start (socket: ...default.sock)
  4. Workaround attempt — start Node daemon directly:
    ode -e require('agent-browser/dist/daemon.js').startDaemon()
  5. Daemon starts and listens on TCP port
  6. Connect to port → daemon crashes within seconds

Environment

  • OS: Windows 11 (10.0.22631) x64
  • Node.js: v25.6.0
  • agent-browser: 0.9.1
  • Chromium: Installed via �gent-browser install --with-deps

Expected Behavior

�gent-browser should work on Windows, using TCP sockets (as the Node.js daemon already implements) or Windows named pipes.

Suggested Fix

  1. The Rust binary should check for .port file and connect via TCP on Windows (matching the Node.js daemon behavior)
  2. The Node.js daemon's TCP server should not crash after receiving connections

Workaround

Using
px playwright screenshot for headless browser automation on Windows in the meantime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions