Description
OpenCode Desktop v1.14.30 → v1.14.39 update: the sidecar runtime switched from Bun to Node.js/Electron's bundled Node.js. This breaks all third-party plugins built with --target bun, because they depend on Bun-specific APIs such as globalThis.Bun.spawn, Bun.file, Bun.serve, Bun.which, etc.
Reproduction
- Install OpenCode Desktop v1.14.39
- Add a Bun-built plugin to config, e.g.
oh-my-openagent@latest
- Start Desktop → sidecar crashes, logs show:
Cannot destructure property 'spawn' of 'globalThis.Bun' as it is undefined
- Or 0-byte sidecar log files
Affected Plugins
- oh-my-openagent (v3.17.14): uses
Bun.spawn, Bun.file, Bun.write, Bun.which, Bun.serve, Bun.hash, Bun.readableStreamToText
- opencode-pty: depends on
bun-pty native module (cannot work in Node.js)
- @tarquinen/opencode-dcp: ESM directory import resolution issue
Workaround (temporary)
A Bun → Node.js polyfill can be injected at the top of the cached plugin file to fix oh-my-openagent, but it's fragile:
- It gets overwritten when Desktop re-downloads the plugin
- Some plugins (opencode-pty) use native Bun addons and cannot be polyfilled
Suggested Fix
- Restore Desktop sidecar to use Bun runtime, or
- Provide a config option to select sidecar runtime (Bun / Node.js), or
- Ship a Bun API polyfill layer in Desktop's Node.js sidecar
Related Issues
Environment
- OS: Windows 11
- OpenCode Desktop: 1.14.39
- OpenCode CLI: 1.14.39 (via Bun, works fine)
- Node.js: bundled with Desktop
Description
OpenCode Desktop v1.14.30 → v1.14.39 update: the sidecar runtime switched from Bun to Node.js/Electron's bundled Node.js. This breaks all third-party plugins built with
--target bun, because they depend on Bun-specific APIs such asglobalThis.Bun.spawn,Bun.file,Bun.serve,Bun.which, etc.Reproduction
oh-my-openagent@latestCannot destructure property 'spawn' of 'globalThis.Bun' as it is undefinedAffected Plugins
Bun.spawn,Bun.file,Bun.write,Bun.which,Bun.serve,Bun.hash,Bun.readableStreamToTextbun-ptynative module (cannot work in Node.js)Workaround (temporary)
A Bun → Node.js polyfill can be injected at the top of the cached plugin file to fix oh-my-openagent, but it's fragile:
Suggested Fix
Related Issues
Environment