continue icon indicating copy to clipboard operation
continue copied to clipboard

Fix: Prioritize user-defined embed models over Transformers.js built-in

Open PhilipAD opened this issue 6 months ago • 3 comments

Description

When defining an embed model with roles: [embed] in the YAML config file, the extension defaults to using the built-in Transformers.js embedder instead of the user-defined model. This PR fixes this issue by ensuring user-configured embed models in config.yaml are prioritized over the built-in Transformers.js model.

Changes Made

  1. Updated core/config/yaml/loadYaml.ts to:
    • Only add the Transformers.js embedder when no other embed models exist
    • Explicitly initialize the selected embed model to prioritize non-Transformers.js models
  2. Enhanced core/config/selectedModels.ts to prioritize non-Transformers.js models when selecting the initial embed model

Testing

I've tested these changes with a custom OpenAI-compatible embed model defined in config.yaml with roles: [embed], and confirmed that:

  • The custom model is now automatically selected on startup
  • The built-in Transformers.js model is still available as a fallback
  • The changes don't affect other model roles

Checklist

  • [x] I've read the contributing guide
  • [x] The relevant docs, if any, have been updated or created
  • [x] The relevant tests, if any, have been updated or created

PhilipAD avatar May 07 '25 10:05 PhilipAD

Deploy Preview for continuedev canceled.

Name Link
Latest commit 18bc7a55482cbeb07662d5c868c04652dae67b66
Latest deploy log https://app.netlify.com/sites/continuedev/deploys/681b49777f73ce000800cb88

netlify[bot] avatar May 07 '25 10:05 netlify[bot]

Nice find! I want to make sure we are able to test this, but I also understand that the work required to do that would probably blow up the scope of this PR. I'm going to make an attempt at doing this before merging

sestinj avatar May 10 '25 00:05 sestinj

✨ No issues found! Your code is sparkling clean! ✨

recurseml[bot] avatar Jun 13 '25 21:06 recurseml[bot]

Does this still need merging? @sestinj

PhilipAD avatar Jul 03 '25 10:07 PhilipAD

looking back at this I realistically don't think it's something we want to change given the amount of feedback we've gotten about this particular ability versus the critical path that it would be updating. we may be able to circle back to this later but especially given the decreased prevalence of embeddings vs. agentic search it doesn't feel high on our priority list. as always open to further feedback if you have it

sestinj avatar Jul 31 '25 04:07 sestinj