Skip to content

Desktop v1.14.39: Bun-target plugins fail to load (Node.js sidecar lacks Bun APIs) #25880

Description

@ckforce

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

  1. Install OpenCode Desktop v1.14.39
  2. Add a Bun-built plugin to config, e.g. oh-my-openagent@latest
  3. 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

  1. Restore Desktop sidecar to use Bun runtime, or
  2. Provide a config option to select sidecar runtime (Bun / Node.js), or
  3. 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

Activity

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