GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(embedding): isolate Windows local ONNX in a Node subprocess by EyJunge1 · Pull Request #521 · tickernelz/opencode-mem

Conversation

@EyJunge1

@EyJunge1 EyJunge1 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes #518: on Windows, local embeddings never load onnxruntime-node inside the OpenCode/Bun host (Bun↔ORT NAPI segfaults; Bug: Segmentation fault when using ONNX runtime on Windows oven-sh/bun#28008).
  • Worker runs in a Node (preferred) or Bun subprocess over JSON-line IPC; parent SIGKILLs on dispose/idle and re-spawns after a worker crash.
  • Hardening: start mutex, spawn errors, request timeouts, package-root cwd/NODE_PATH, non-JSON stdout ignored, stderr for worker logs.

Test plan

  • bun run typecheck
  • bun test tests/embedding-subprocess.test.ts tests/embedding-idle-dispose.test.ts
  • Windows: opencode serve + local embeddings with Node (or Bun) on PATH — host must not segfault under the [Bug] Segfault in onnxruntime_binding.node under OpenCode 2.3.2 (Windows x64, Bun 1.4.4) — reproducible, isolated to opencode-mem 2.43.0 #518 workload
  • Windows without Node/Bun on PATH: clear error → use remote embeddings
  • Linux/macOS unchanged unless OPENCODE_MEM_EMBEDDING_SUBPROCESS=1

Checklist

  • Branch is based on main
  • Tests + typecheck pass
  • README updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
EyJunge1 added 2 commits November 24, 2026 11:54
@EyJunge1
fix(embedding): isolate Windows local ONNX in a Node subprocess
c3cb851
Bun hosts segfault when onnxruntime-node loads in-process on Windows
(#518). Run the transformers/ORT pipeline in a Node child over JSON-line
IPC and SIGKILL it on dispose so NAPI finalizers never run in OpenCode.
@EyJunge1
fix(embedding): harden Windows ONNX subprocess isolation
14d6fc6
Add start mutex, spawn error handling, request timeouts, package-root
cwd/NODE_PATH, Bun-child fallback when Node is missing, stdout filtering,
and one-shot re-warmup after a worker crash so #518 stays host-safe.
@EyJunge1 EyJunge1 mentioned this pull request Nov 24, 2026
[Bug] Segfault in onnxruntime_binding.node under OpenCode 2.3.2 (Windows x64, Bun 1.4.4) — reproducible, isolated to opencode-mem 2.43.0 #518
Closed
EyJunge1 added 2 commits November 24, 2026 11:58
@EyJunge1
fix(embedding): harden worker discovery for OpenCode hosts
5338bf7
Resolve the embedding worker via import.meta.path/dirname when url is
empty (#210), search standard Node/Bun install paths beyond PATH, walk
up to the package root for node_modules, and SIGKILL a wedged child on
request timeout.
@EyJunge1
fix(embedding): run Windows ONNX worker via OpenCode BUN_BE_BUN
66acdc0
When Node/Bun are not on PATH, re-exec process.execPath with BUN_BE_BUN=1
so a Bun --compile host (OpenCode standalone) acts as the Bun CLI and
runs the embedding worker without a separate runtime install (#518).
@EyJunge1
EyJunge1 merged commit a755b1d into main Nov 24, 2026
10 of 15 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@EyJunge1 EyJunge1 mentioned this pull request Nov 24, 2026
chore(release): release v2.44.0 #522
Merged
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug] Segfault in onnxruntime_binding.node under OpenCode 2.3.2 (Windows x64, Bun 1.4.4) — reproducible, isolated to opencode-mem 2.43.0

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@EyJunge1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.