Skip to content

WSL: toasts never appear after a fresh install until snoretoast-x64.exe is chmod +x #151

Closed

Description

@cardin

WSL: toasts never appear after a fresh install until snoretoast-x64.exe is chmod +x

Summary

On WSL2, a fresh install of the plugin never shows Windows toast notifications. The
failure is silent, even with OPENCODE_NOTIFIER_DEBUG=1.

node-notifier's bundled snoretoast-x64.exe is unpacked with mode 0644. WSL2 still
enforces the Unix execute bit when launching a Windows binary, so every toast spawn
fails with EACCES. WindowsToaster only forwards errors whose code === -1, so the
error is swallowed and the plugin's callback never sees a failure. chmod +x on the
binary fixes it until the next plugin update re-extracts the cache.

Environment

  • OS: WSL2, Ubuntu 26.04
  • Windows: Windows 11 Home, 10.0.26300.9974
  • Terminal: Windows Terminal
  • OpenCode: v2.3.0
  • Plugin: @mohak34/opencode-notifier@1.1.2

Reproduction

  1. Start from a WSL2 environment where the plugin has not been installed before, so no
    prior chmod exists.
  2. Install @mohak34/opencode-notifier@1.1.2 and trigger any notification event
    (completion, permission, or error).
  3. No toast appears and OpenCode logs nothing.
$ ls -l ~/.cache/opencode/npm/@mohak34/opencode-notifier@latest/*/node_modules/node-notifier/vendor/snoreToast/
-rw-r--r-- 1 cardi cardi 2519032 ... snoretoast-x64.exe
-rw-r--r-- 1 cardi cardi 2065912 ... snoretoast-x86.exe

$ ./snoretoast-x64.exe -help
bash: ./snoretoast-x64.exe: Permission denied

$ chmod +x snoretoast-x64.exe   # toasts then work

Root cause

The node-notifier repository stores both executables as 100755, but the published npm
tarball contains them as 0644 (npm normalizes file modes on publish):

$ npm pack node-notifier@10.0.1
$ tar -tvzf node-notifier-10.0.1.tgz | grep snoretoast
-rw-r--r-- ... package/vendor/snoreToast/snoretoast-x64.exe
-rw-r--r-- ... package/vendor/snoreToast/snoretoast-x86.exe

This is the WSL case documented in node-notifier's README and issue
mikaelbr/node-notifier#353.
The README here links that note, but it requires users to discover it and repeat the
chmod after every plugin update.

Proposed fix

Restore the execute bit when the plugin loads on WSL, before WindowsToaster is
constructed. The same workaround is already used by a local plugin, and it fixes the
clean-install case end to end. PR follows.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions