fix(embedding): fix transformers resolve in OpenCode Bun compile host (#210) - #223
Merged
EyJunge1 merged 3 commits intoJul 30, 2026
Merged
Conversation
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Cannot find module '@huggingface/transformers' from ''under OpenCode's Bun--compilehost.@huggingface/transformersto an absolute path before installing the onnxruntimeModule._resolveFilenameshim, then load that absolute entry so the 1.22.0 pin still applies to nested requires.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
bun test tests/runtime-require.test.ts tests/onnxruntime-resolve.test.tsbun run typecheckbun scripts/verify-nested-onnxruntime-fixture.mjs(includes compiled host)SKIP_COMPILE_HOST=1 node scripts/verify-nested-onnxruntime-fixture.mjsmacos-15-intelnested OpenCode fixture (Bun 1.3.14 + Node 22) greenmemory add/memory searchafter cache reinstall on Intel MacFixes #210
Made with Cursor