Summary
cursor-acp fails to load in OpenCode on macOS because the installed @opencode-ai/plugin dependency emits extensionless relative ESM imports.
This prevents the local Cursor ACP proxy from starting on 127.0.0.1:32124, which then causes ECONNREFUSED when selecting cursor-acp/* models.
Environment
- macOS arm64
- OpenCode:
1.15.11
@rama_nigg/open-cursor: 2.4.6
- Installed via the one-line installer / global npm package
- Cursor Agent: installed and
cursor-agent models works
Error
OpenCode desktop logs repeatedly showed plugin load failures like:
Cannot find module '/opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/node_modules/@opencode-ai/plugin/dist/tool' imported from /opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/node_modules/@opencode-ai/plugin/dist/index.js
failed to load plugin
Direct reproduction:
node -e "import('/opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/dist/plugin-entry.js').then(()=>console.log('import ok')).catch(e=>{console.error(e.message); process.exit(1)})"
Before patch, that prints the same Cannot find module .../dist/tool error.
Root cause
The package is ESM ("type": "module"), but the bundled dependency file contains extensionless relative imports:
// node_modules/@opencode-ai/plugin/dist/index.js
export * from "./tool";
The file exists as tool.js, but Node/Electron ESM resolution does not add .js for relative imports.
example.js has the same pattern:
import { tool } from "./tool";
Local workaround that fixed it
Patching the installed dependency to include .js fixed plugin import and Cursor ACP runtime:
// node_modules/@opencode-ai/plugin/dist/index.js
-export * from "./tool";
+export * from "./tool.js";
// node_modules/@opencode-ai/plugin/dist/example.js
-import { tool } from "./tool";
+import { tool } from "./tool.js";
After patch:
node -e "import('/opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/dist/plugin-entry.js').then(()=>console.log('import ok')).catch(e=>{console.error(e.stack||e.message); process.exit(1)})"
prints:
Then:
opencode models cursor-acp
opencode run "Reply exactly: CURSOR_ACP_FIXED" -m cursor-acp/composer-2.5-fast
both work. The run returned the expected CURSOR_ACP_FIXED response.
Impact
- Repeated OpenCode desktop/sidebar error notifications during project/dashboard initialization.
- Cursor ACP proxy does not start.
- Selecting
cursor-acp/* models fails with connection refused to 127.0.0.1:32124.
Suggested fix
Either:
- publish/fix
@opencode-ai/plugin so its ESM output uses explicit .js extensions for relative imports, or
- make
open-cursor avoid shipping/depending on a broken ESM runtime import path, or
- bundle the required plugin helper code so the dependency import cannot fail at runtime.
The local patch above is not durable because npm update -g @rama_nigg/open-cursor or reinstalling can overwrite it.
Summary
cursor-acpfails to load in OpenCode on macOS because the installed@opencode-ai/plugindependency emits extensionless relative ESM imports.This prevents the local Cursor ACP proxy from starting on
127.0.0.1:32124, which then causesECONNREFUSEDwhen selectingcursor-acp/*models.Environment
1.15.11@rama_nigg/open-cursor:2.4.6cursor-agent modelsworksError
OpenCode desktop logs repeatedly showed plugin load failures like:
Direct reproduction:
node -e "import('/opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/dist/plugin-entry.js').then(()=>console.log('import ok')).catch(e=>{console.error(e.message); process.exit(1)})"Before patch, that prints the same
Cannot find module .../dist/toolerror.Root cause
The package is ESM (
"type": "module"), but the bundled dependency file contains extensionless relative imports:The file exists as
tool.js, but Node/Electron ESM resolution does not add.jsfor relative imports.example.jshas the same pattern:Local workaround that fixed it
Patching the installed dependency to include
.jsfixed plugin import and Cursor ACP runtime:After patch:
node -e "import('/opt/homebrew/lib/node_modules/@rama_nigg/open-cursor/dist/plugin-entry.js').then(()=>console.log('import ok')).catch(e=>{console.error(e.stack||e.message); process.exit(1)})"prints:
Then:
opencode models cursor-acp opencode run "Reply exactly: CURSOR_ACP_FIXED" -m cursor-acp/composer-2.5-fastboth work. The run returned the expected
CURSOR_ACP_FIXEDresponse.Impact
cursor-acp/*models fails with connection refused to127.0.0.1:32124.Suggested fix
Either:
@opencode-ai/pluginso its ESM output uses explicit.jsextensions for relative imports, oropen-cursoravoid shipping/depending on a broken ESM runtime import path, orThe local patch above is not durable because
npm update -g @rama_nigg/open-cursoror reinstalling can overwrite it.