Skip to content

Conversation

@0okay
Copy link
Contributor

@0okay 0okay commented Feb 3, 2026

This PR fixes a critical issue on Windows where the agent-browser daemon fails to start automatically when running CLI commands like 'agent-browser open'.

The Issue

On Windows, the native binary wrapper mechanism relied on the daemon being already running or properly spawned, but due to platform differences, the automatic daemon startup was failing silently, leading to:
\Daemon failed to start (socket: ...)\

The Fix

  1. Introduced a new \�in/agent-browser.js\ Node.js wrapper that replaces the shell script entry point in \package.json.
  2. Added \ensureDaemonRunning()\ logic that:
    • Checks if the daemon port file exists.
    • If missing, automatically spawns the daemon process (\dist/daemon.js) in the background.
    • Waits up to 3 seconds for the daemon to initialize before proceeding.
  3. Updated \package.json\ to point \�in\ to this new JS wrapper.

This ensures a seamless experience for Windows users (via
px\ or global install) while maintaining compatibility with other platforms.

@vercel
Copy link
Contributor

vercel bot commented Feb 3, 2026

@0okay is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

async function ensureDaemonRunning() {
if (platform() !== 'win32') return;

const agentDir = join(homedir(), '.agent-browser');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Port file path mismatch between daemon writer and wrapper reader causes daemon detection to always fail on Windows

Fix on Vercel

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.

1 participant