Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ updates:
- "minor"
- "patch"
ignore:
# Keep this pin until https://github.com/microsoft/onnxruntime/issues/27961 is resolved.
# Keep this pin until onnxruntime ships a darwin/x64 build after the
# macOS Ort::Env teardown fix (#27961 / #24579) and OpenCode embeds Bun >1.3.14.
- dependency-name: "onnxruntime-node"

- package-ecosystem: "github-actions"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/embedding-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
matrix:
# Intel: macos-15-intel / macos-26-intel (darwin/x64).
# Apple Silicon: macos-15 / macos-26 (darwin/arm64).
# Intel must keep resolving onnxruntime-node@1.22.0 (#184 / #210).
# Intel must keep resolving onnxruntime-node@1.20.1 (#184 / #210 / #225).
os:
[
ubuntu-latest,
Expand Down Expand Up @@ -87,8 +87,9 @@ jobs:
- name: Embedding smoke (Node)
run: node scripts/verify-embedding-backend.mjs

# Targeted #210 regression: OpenCode-shaped nested install on the oldest
# Targeted #210 / #225 regression: OpenCode-shaped nested install on the oldest
# available standard Intel runner, using the reporter's Bun/Node versions.
# Compiled host must run real inference and exit 0 (no Ort::Env SIGILL).
nested-intel-regression:
name: macos-15-intel / nested OpenCode fixture
runs-on: macos-15-intel
Expand All @@ -114,7 +115,7 @@ jobs:
- name: Build package
run: bun run build

- name: Nested fixture + compiled host + embedding (Bun 1.3.14)
- name: Nested fixture + compiled host inference/exit (Bun 1.3.14)
run: bun scripts/verify-nested-onnxruntime-fixture.mjs

- name: Nested fixture + embedding (Node 22)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Example — remote OpenAI embeddings:

Changing `embeddingModel` (or dimensions) can trigger re-embedding of stored memories on next startup. Prefer picking a model once and sticking with it for a given data directory.

**Intel Mac (`darwin/x64`):** newer `onnxruntime-node` builds may ship without an x64 native binding, so local embedding init can fail. `opencode-mem` pins `onnxruntime-node@1.22.0` and loads transformers through a CJS resolve shim so OpenCode nested installs keep that binding. Transformers is resolved to an absolute path before that shim is installed so OpenCode's Bun `--compile` host does not fail with `Cannot find module '@huggingface/transformers' from ''`. If init still fails after a plugin upgrade, clear OpenCode's nested plugin cache (`~/.cache/opencode/packages/opencode-mem@*`) and reinstall, or use a remote endpoint via `embeddingApiUrl` + `embeddingApiKey` (example above).
**Intel Mac (`darwin/x64`):** `onnxruntime-node@1.21.0` through `1.23.2` can crash OpenCode's embedded Bun `1.3.14` during process exit after successful local embeddings (`Ort::Env` teardown / SIGILL). The fix shipped in `1.24.1`, but fixed releases still lack an x64 native binding. `opencode-mem` therefore pins `onnxruntime-node@1.20.1` and loads transformers through a CJS resolve shim so OpenCode nested installs keep that binding. Transformers is resolved to an absolute path before that shim is installed so OpenCode's Bun `--compile` host does not fail with `Cannot find module '@huggingface/transformers' from ''`. After upgrading, clear OpenCode's nested plugin cache (`~/.cache/opencode/packages/opencode-mem@*`) and reinstall, or use a remote endpoint via `embeddingApiUrl` + `embeddingApiKey` (example above). This pin stays until onnxruntime publishes a post-teardown-fix darwin/x64 build.

### Memory Scope

Expand Down Expand Up @@ -351,7 +351,7 @@ Troubleshooting:
- If auto-capture reports that a provider is not connected, confirm the provider name with `opencode providers list` and configure that provider in opencode first.
- If a proxy or custom provider returns plain text instead of structured/tool output, choose another model/provider or use one of the manual provider modes above.
- For models that reject `temperature`, add `"memoryTemperature": false` when using manual API configuration.
- **Intel Mac (darwin/x64) local embedding:** if embedding init fails, clear `~/.cache/opencode/packages/opencode-mem@*` after upgrading so the nested install picks up the pinned `onnxruntime-node@1.22.0`, or switch to a remote embedding endpoint via `embeddingApiUrl` + `embeddingApiKey`. See [Choosing / configuring embeddings](#choosing-configuring-embeddings). MLX is not supported.
- **Intel Mac (darwin/x64) local embedding:** if embedding init fails or OpenCode exits with SIGILL after local memory use, clear `~/.cache/opencode/packages/opencode-mem@*` after upgrading so the nested install picks up the pinned `onnxruntime-node@1.20.1`, or switch to a remote embedding endpoint via `embeddingApiUrl` + `embeddingApiKey`. See [Choosing / configuring embeddings](#choosing-configuring-embeddings). MLX is not supported.

## Public Subpath Exports

Expand Down
Loading