Skip to content

Conversation

@feketegabor
Copy link

Summary

  • Start daemon via PowerShell Start-Process on Windows to avoid cmd/path escaping issues.
  • Strip \?\ prefix to prevent "Windows cannot access \?" dialog failures.
  • Allow the daemon to fall back to an OS-assigned port when the hashed port is unavailable, and persist it to a .port file.
  • Read the .port file from the CLI to connect to the correct session port.
  • Increase Windows connect timeouts for daemon readiness checks.

Fixes

Fixes #132
Fixes #37
Fixes #91
Fixes #89

Testing

  • agent-browser open https://example.com
  • agent-browser snapshot -i
  • agent-browser get title
  • agent-browser get url
  • agent-browser find text "Learn more" click --exact
  • agent-browser wait --load networkidle
  • agent-browser screenshot --full
  • agent-browser set viewport 1200 800
  • agent-browser --session alpha open https://example.com
  • agent-browser --session beta open https://example.org
  • agent-browser session list
  • agent-browser --session alpha snapshot -i
  • agent-browser --session beta get title
  • agent-browser close
  • agent-browser --session alpha close
  • agent-browser --session beta close

- Start daemon via PowerShell Start-Process to avoid Windows path/escaping issues

- Strip \\\?\ prefix to prevent Windows dialog errors

- Allow daemon to fall back to an OS-assigned port and persist it to a .port file

- Read the .port file on the CLI to connect to the correct session port

- Increase TCP readiness timeouts on Windows
@vercel
Copy link
Contributor

vercel bot commented Jan 29, 2026

Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@feketegabor feketegabor force-pushed the fix/windows-daemon-ports branch from 28d2d81 to 69df523 Compare January 29, 2026 02:01
@DoiiarX
Copy link

DoiiarX commented Jan 30, 2026

wait for it

Copy link

@samonjoat samonjoat left a comment

Choose a reason for hiding this comment

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

Verified on Windows 11 (x86_64), agent-browser v0.9.0 base, Rust 1.93.0

Built from this branch and tested against the installed v0.9.0 Node.js package. All tests pass:

  • agent-browser open <url> — daemon starts reliably
  • Rapid close/reopen cycles (3x) — no "Daemon failed to start" errors
  • Named sessions (--session alpha, --session beta) — concurrent sessions work correctly
  • .port file created at ~/.agent-browser/default.port — port discovery mechanism is functional
  • Windows excluded port range (50000–50059 via netsh) is present on this system — the fallback port mechanism correctly avoids conflicts

Environment:

  • OS: Windows 11 (MSYS_NT-10.0)
  • Node.js: v22.x
  • Shell: Git Bash
  • Excluded TCP ports: 50000–50059

The increased timeouts (50ms → 200ms) and PowerShell Start-Process launch strategy resolve the race condition described in #37. The .port file fallback addresses #132. This should be merged.

@mmjang
Copy link

mmjang commented Feb 5, 2026

Please, please merge and release this : / Windows users will thank you.

@NicolasCaous
Copy link

NicolasCaous commented Feb 11, 2026

@mmjang While the maintainers don't merge this, you can build it from his source repo. I did it, and it works flawlessly. By the way, thanks @feketegabor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants