fix(embedding): skip warmup for remote providers#89
fix(embedding): skip warmup for remote providers#89gabrielrinaldi wants to merge 1 commit intotickernelz:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts embedding initialization so that when an external (OpenAI-compatible) embeddings API is configured, the service skips local model warmup and avoids loading the @xenova/transformers stack, preventing unnecessary startup failures in remote-embedding setups.
Changes:
- Short-circuit
EmbeddingService.warmup()whenembeddingApiUrlandembeddingApiKeyare set (remote mode). - Update
bun.lockmetadata (configVersion).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/services/embedding.ts | Skips local embedding warmup for remote providers to avoid loading local transformer dependencies unnecessarily. |
| bun.lock | Lockfile metadata update (configVersion). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for digging into this. From tracing the current code, I think the remote warmup short-circuit may already exist today.
Could you share the concrete repro or stack trace this fixes, or add a regression test showing current startup still reaches the local transformer path in remote mode? If there is an existing bug here, I think we should target that path directly rather than duplicate the remote-mode check. |
|
I think #90 is a more elegant solutions, closing this |
Summary
embeddingApiUrlandembeddingApiKeyare configured@xenova/transformersstack for remote embedding setupsWhy
OpenCode installs plugins with
bun add --ignore-scripts, which can leave native transitive dependencies unresolved in some environments. Foropencode-mem, remote embedding mode does not need local transformer warmup, so eagerly warming that path can fail unnecessarily during plugin startup.This change keeps remote embedding mode on the remote path from the start, which avoids startup failures while leaving local embedding behavior unchanged.