What happened?
What happened?
On macOS, @mariozechner/clipboard aborts if pasteboard access is denied by a sandbox or isolation profile. In current pi, coding-agent startup imports clipboard helpers eagerly, so interactive mode can die before any user clipboard action.
Observed failure:
unexpected NULL returned from +[NSPasteboard generalPasteboard]
thread caused non-unwinding panic. aborting.
Steps to reproduce
- Run Node on macOS under a
sandbox-exec profile that denies pasteboard lookup.
- In that sandboxed process, load
@mariozechner/clipboard.
- Call a clipboard method that touches
NSPasteboard, for example hasImage().
Minimal shape:
const clipboard = require("@mariozechner/clipboard");
clipboard.hasImage();
On my machine that aborts with exit 134 and:
unexpected NULL returned from +[NSPasteboard generalPasteboard]
thread caused non-unwinding panic. aborting.
I also have verified local fixtures for both the failing raw path and the succeeding lazy-load path, and a clean fix branch ready if maintainers want me to open the PR:
https://github.com/thegalexc/pi-mono/tree/fix/clipboard-sandbox-pasteboard-crash
Expected behavior
Interactive startup should succeed. Clipboard access should only reach the native addon on actual clipboard use, and denied pasteboard access should not abort startup.
Version
@earendil-works/pi-coding-agent 0.74.0, Node 24.12.0, macOS
Version
0.74.0
What happened?
What happened?
On macOS,
@mariozechner/clipboardaborts if pasteboard access is denied by a sandbox or isolation profile. In currentpi, coding-agent startup imports clipboard helpers eagerly, so interactive mode can die before any user clipboard action.Observed failure:
Steps to reproduce
sandbox-execprofile that denies pasteboard lookup.@mariozechner/clipboard.NSPasteboard, for examplehasImage().Minimal shape:
On my machine that aborts with exit
134and:I also have verified local fixtures for both the failing raw path and the succeeding lazy-load path, and a clean fix branch ready if maintainers want me to open the PR:
https://github.com/thegalexc/pi-mono/tree/fix/clipboard-sandbox-pasteboard-crashExpected behavior
Interactive startup should succeed. Clipboard access should only reach the native addon on actual clipboard use, and denied pasteboard access should not abort startup.
Version
@earendil-works/pi-coding-agent0.74.0, Node 24.12.0, macOSVersion
0.74.0