Summary
Related to #158 (fixed by #163). This is not a duplicate: #163's intended fix (pin onnxruntime-node to 1.22.0 via overrides) does not take effect under OpenCode's actual plugin dependency installation model, so Intel Mac (darwin/x64) local embedding remains broken on opencode-mem v2.20.0.
Environment
| Item |
Value |
| OS / arch |
macOS Intel (darwin/x64) |
| OpenCode |
1.18.3 |
| opencode-mem |
2.20.0 |
| Embedding |
default local: Xenova/nomic-embed-text-v1 |
Actual behavior
Clean/direct OpenCode install under:
~/.cache/opencode/packages/opencode-mem@2.20.0
resolves @huggingface/transformers@4.2.0 → nested onnxruntime-node@1.24.3, which ships only darwin/arm64 and lacks darwin/x64.
Exact error:
Cannot find module '../bin/napi-v6/darwin/x64/onnxruntime_binding.node'
Followed by:
Failed to initialize embedding model
Plugin warmup failed
Memory feature stays stuck in initializing.
Expected behavior
PR #163's pin to onnxruntime-node@1.22.0 should make Intel local embedding work (native binding present for darwin/x64).
Root cause evidence
The published opencode-mem@2.20.0 package places:
"overrides": {
"onnxruntime-node": "1.22.0"
}
in the nested dependency package (opencode-mem itself), not as something the install root applies.
npm/Arborist only honors root-level overrides. OpenCode's plugin loader installs the plugin tree such that this nested override is ignored, so resolution stays on onnxruntime-node@1.24.3 (no x64 binary). OpenCode's cache also reuses the already-installed tree, so a package-only override change does not self-heal existing installs.
Verified workaround
Replacing both:
- the top-level resolved
onnxruntime-node, and
@huggingface/transformers/node_modules/onnxruntime-node
with 1.22.0 provides the x86_64 binding + dylib, makes require succeed, and yields:
Embedding model warmed up
with no subsequent warmup errors.
Suggested fixes
- Make
onnxruntime-node@1.22.0 an effective direct/bundled dependency (or otherwise force resolution at the install root), not a nested-only overrides entry.
- Add a post-resolve platform artifact check (fail fast with a clear message if
darwin/x64 binding is missing).
- Until fixed, document remote embedding fallback for Intel Mac users.
Upstream context (missing platform binary packaging): microsoft/onnxruntime#27961
Reproduction (concise)
- On macOS Intel, use OpenCode 1.18.3 with opencode-mem 2.20.0 and default local embedding.
- Let OpenCode install the plugin to
~/.cache/opencode/packages/opencode-mem@2.20.0.
- Inspect nested resolution:
@huggingface/transformers@4.2.0 → onnxruntime-node@1.24.3 (arm64-only layout; no darwin/x64).
- Trigger memory/embedding warmup → observe the exact
napi-v6/darwin/x64/onnxruntime_binding.node module-not-found error and warmup failure above.
- (Optional) Manually install
onnxruntime-node@1.22.0 into both resolution locations described under Workaround → warmup succeeds.
Happy to provide additional sanitized logs if needed.
Summary
Related to #158 (fixed by #163). This is not a duplicate: #163's intended fix (pin
onnxruntime-nodeto1.22.0viaoverrides) does not take effect under OpenCode's actual plugin dependency installation model, so Intel Mac (darwin/x64) local embedding remains broken on opencode-mem v2.20.0.Environment
darwin/x64)Xenova/nomic-embed-text-v1Actual behavior
Clean/direct OpenCode install under:
resolves
@huggingface/transformers@4.2.0→ nestedonnxruntime-node@1.24.3, which ships onlydarwin/arm64and lacksdarwin/x64.Exact error:
Followed by:
Memory feature stays stuck in initializing.
Expected behavior
PR #163's pin to
onnxruntime-node@1.22.0should make Intel local embedding work (native binding present fordarwin/x64).Root cause evidence
The published
opencode-mem@2.20.0package places:in the nested dependency package (opencode-mem itself), not as something the install root applies.
npm/Arborist only honors root-level
overrides. OpenCode's plugin loader installs the plugin tree such that this nested override is ignored, so resolution stays ononnxruntime-node@1.24.3(no x64 binary). OpenCode's cache also reuses the already-installed tree, so a package-only override change does not self-heal existing installs.Verified workaround
Replacing both:
onnxruntime-node, and@huggingface/transformers/node_modules/onnxruntime-nodewith
1.22.0provides thex86_64binding + dylib, makesrequiresucceed, and yields:with no subsequent warmup errors.
Suggested fixes
onnxruntime-node@1.22.0an effective direct/bundled dependency (or otherwise force resolution at the install root), not a nested-onlyoverridesentry.darwin/x64binding is missing).Upstream context (missing platform binary packaging): microsoft/onnxruntime#27961
Reproduction (concise)
~/.cache/opencode/packages/opencode-mem@2.20.0.@huggingface/transformers@4.2.0→onnxruntime-node@1.24.3(arm64-only layout; nodarwin/x64).napi-v6/darwin/x64/onnxruntime_binding.nodemodule-not-found error and warmup failure above.onnxruntime-node@1.22.0into both resolution locations described under Workaround → warmup succeeds.Happy to provide additional sanitized logs if needed.