Skip to content

fix(embedding): fix transformers resolve in OpenCode Bun compile host (#210) - #223

Merged
EyJunge1 merged 3 commits into
tickernelz:mainfrom
EyJunge1:fix/opencode-compiled-host-require
Jul 30, 2026
Merged

fix(embedding): fix transformers resolve in OpenCode Bun compile host (#210)#223
EyJunge1 merged 3 commits into
tickernelz:mainfrom
EyJunge1:fix/opencode-compiled-host-require

Conversation

@EyJunge1

Copy link
Copy Markdown
Collaborator

Summary

  • Reproduce and fix the [Bug] v2.22.0 Intel Mac: fail-fast reports onnxruntime binding missing though file exists and loads under Node/Bun #210 follow-up error Cannot find module '@huggingface/transformers' from '' under OpenCode's Bun --compile host.
  • Resolve @huggingface/transformers to an absolute path before installing the onnxruntime Module._resolveFilename shim, then load that absolute entry so the 1.22.0 pin still applies to nested requires.
  • Add a shared createRuntimeRequire() helper and an OpenCode-shaped compiled-host nested fixture so CI exercises the real production load path instead of a separately anchored require.

Test plan

Fixes #210

Made with Cursor

EyJunge1 added 3 commits July 30, 2026 16:01
tickernelz#210)

OpenCode's Bun --compile host breaks non-onnx package resolve after the
Module._resolveFilename shim, surfacing as `from ''`. Resolve transformers
to an absolute path first, share a runtime require helper, and cover the
real compiled plugin load path in CI.
…tests

Updated test cases to replace backslashes with forward slashes in the resolved path for the '@huggingface/transformers' module, ensuring consistent behavior across different environments. Increased timeout for certain test cases to prevent premature failures.
…mup handling

Removed the test for loading local transformers backend to prevent double loading of the ONNX stack, which can cause crashes in Bun 1.3.14. Enhanced the warmup state management in the plugin-loader contract tests to ensure stability during process teardown.
@EyJunge1
EyJunge1 merged commit 2dc079f into tickernelz:main Jul 30, 2026
14 checks passed
@EyJunge1 EyJunge1 mentioned this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant