Skip to content

[Bug] v2.22.0 Intel Mac: fail-fast reports onnxruntime binding missing though file exists and loads under Node/Bun #210

Description

@tlerbao

Summary

On an Intel Mac, opencode-mem@2.22.0 still reports that the pinned onnxruntime-node binding is missing when invoked through OpenCode, even though the exact file exists and both Node and Bun can load it successfully outside the plugin tool call.

This appears different from #158 and #184: in those reports the x64 artifact was actually absent. Here the direct onnxruntime-node@1.22.0 artifact is present and loadable after a clean plugin-cache reinstall.

Environment

  • macOS 13.3, Intel x86_64 (darwin/x64)
  • OpenCode 1.18.9
  • Bun 1.3.14
  • Node.js v22.19.0
  • opencode-mem 2.22.0
  • Local embedding model: Xenova/nomic-embed-text-v1

Steps to reproduce

  1. Configure the plugin as opencode-mem@2.22.0.

  2. Completely exit OpenCode.

  3. Remove only the plugin caches:

    rm -rf ~/.cache/opencode/packages/opencode-mem ~/.cache/opencode/packages/opencode-mem@latest ~/.cache/opencode/packages/opencode-mem@2.22.0
  4. Start OpenCode and allow it to reinstall the plugin.

  5. Completely exit and start OpenCode again after installation is complete.

  6. Invoke the memory tool in add or search mode.

Actual behavior

Both add and search fail with:

Local embedding native binding missing for darwin/x64 at ~/.cache/opencode/packages/opencode-mem@2.22.0/node_modules/onnxruntime-node/bin/napi-v6/darwin/x64/onnxruntime_binding.node. On Intel Mac (darwin/x64), onnxruntime-node@1.24+ ships without an x64 binding; opencode-mem pins 1.22.0. If this persists after updating, clear OpenCode's plugin cache (~/.cache/opencode/packages/opencode-mem@*) and reinstall, or configure remote embeddings via embeddingApiUrl + embeddingApiKey.

The old OpenCode serve --service process was also explicitly terminated before repeating the test in a new OpenCode conversation, with the same result.

Binding verification

The exact path reported as missing exists:

onnxruntime-node version: 1.22.0
binding size: 226664 bytes
file type: Mach-O 64-bit bundle x86_64
permissions: 0644

From the freshly installed plugin directory, all of the following succeed under both Node and Bun:

require.resolve("onnxruntime-node")
require("onnxruntime-node")
prepareOnnxruntimeForTransformers()

They resolve to the direct package at:

node_modules/onnxruntime-node/dist/index.js

The plugin's standalone prepareOnnxruntimeForTransformers() check succeeds, but the same OpenCode process reports the binding as missing when the registered memory tool initializes embeddings.

Expected behavior

The local embedding model should initialize using the bundled direct onnxruntime-node@1.22.0 x64 binding, and memory add/search should work.

Related

PR #198 added the direct dependency, resolver shim, and fail-fast check. Its Intel Mac real-device test-plan items appear to have remained unchecked, so this may be an OpenCode plugin-runtime path or initialization-context difference that is not covered by the standalone resolver tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions