Skip to content

fix(pi-extension): run script/executable PLANNOTATOR_BROWSER paths directly on macOS - #1429

Open
punk-dev-robot wants to merge 1 commit into
backnotprop:mainfrom
punk-dev-robot:pi-extension-browser-script-path
Open

fix(pi-extension): run script/executable PLANNOTATOR_BROWSER paths directly on macOS#1429
punk-dev-robot wants to merge 1 commit into
backnotprop:mainfrom
punk-dev-robot:pi-extension-browser-script-path

Conversation

@punk-dev-robot

Copy link
Copy Markdown

Fixes #1391.

On darwin the pi extension's openBrowser always ran open -a $PLANNOTATOR_BROWSER <url>, treating the value as an app bundle. A script or executable path fails with LaunchServices error -10811, the error is swallowed by the detached spawn, and the extension reports "review opened" while nothing opens.

This mirrors the branch the plannotator binary already has in packages/server/browser.ts: a value containing / that does not end with .app is executed directly with the URL as its argument; app names and .app paths keep going through open -a.

Changes

  • apps/pi-extension/server/network.ts: add the direct-exec branch for slash-containing non-.app PLANNOTATOR_BROWSER values on darwin.
  • apps/pi-extension/server/network.test.ts: behavioral test — PLANNOTATOR_BROWSER pointing at a shell script gets executed with the URL as $1 (skipped on win32).

Testing

bun test apps/pi-extension/server/network.test.ts — new test passes; the 3 pre-existing port-binding failures on my machine fail identically on a clean main checkout (local environment, unrelated).

…rectly on macOS

open -a treats the value as an app bundle and fails with LaunchServices
-10811 for script paths, with the error swallowed by the detached spawn.
Mirror the binary's openBrowser branch: a value containing '/' that does
not end with '.app' is executed directly with the URL as its argument.

Fixes backnotprop#1391
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.

pi-extension: PLANNOTATOR_BROWSER silently fails for script/executable paths on macOS

1 participant