Skip to content

fix(hook): support OpenCode Desktop (Node.js) in plugin#2153

Open
synnks wants to merge 1 commit into
rtk-ai:developfrom
synnks:fix/opencode-desktop-plugin
Open

fix(hook): support OpenCode Desktop (Node.js) in plugin#2153
synnks wants to merge 1 commit into
rtk-ai:developfrom
synnks:fix/opencode-desktop-plugin

Conversation

@synnks
Copy link
Copy Markdown

@synnks synnks commented May 29, 2026

Summary

  • Fix OpenCode plugin failing silently in the Desktop app (Electron/Node.js)
  • Add node:child_process fallback when Bun.$ is unavailable

Fixes #2039

Root Cause

OpenCode Desktop runs its server in an Electron utility process (Node.js), not Bun.
OpenCode passes $: undefined to plugins when typeof Bun === "undefined".
The plugin calls await $which rtk.quiet() — since $ is undefined, this throws a TypeError, caught by the catch block with the misleading message "rtk binary not found in PATH".

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • node --experimental-strip-types --test hooks/opencode/tests/rtk.test.ts
  • Manual testing: verified in OpenCode TUI (Bun path) and Desktop (child_process path)

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 29, 2026

CLA assistant check
All committers have signed the CLA.

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.

OpenCode Desktop does not detect rtk when launched from macOS GUI

2 participants