Skip to content

agent-browser is not launchable on Windows #23

Description

@queso

getAgentBrowserPath resolves the agent-browser bin script, but the resolved path is handed straight to Bun.spawn / execFileSync in execCommand (src/runner.ts). On Windows that does not work for two reasons:

  1. Only the extensionless shim is probed. The resolver checks <node_modules>/.bin/agent-browser. On Windows, npm/bun generate agent-browser.cmd (and .ps1) alongside it; the extensionless file is a shell script that Windows will not execute.
  2. The JavaScript-bin fallback has no interpreter. When the shim is missing, the resolver falls back to the package's own bin script (agent-browser@0.9.3 ships a JS file). Windows does not honour the shebang line, so spawning that path directly fails.

Suggested fix

Teach the resolver to return a command descriptor rather than a bare path — something like { command, prependArgs } — so the launch site can:

  • prefer agent-browser.cmd on win32 when it exists, and
  • invoke a JS bin script through process.execPath (node <script>) instead of relying on shebang handling.

Keep the current direct-execution path unchanged on non-Windows platforms.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions