fix: make embedding model ID matching case-insensitive #9027
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.
This PR addresses Issue #9026 where codebase indexing fails with custom providers using different model ID casing.
Problem
Users with custom providers (e.g., OpenRouter) using model IDs with different casing than defined in our profiles (like
Qwen/Qwen3-Embedding-8Bvsqwen/qwen3-embedding-8b) were experiencing indexing failures. While regular Roo Code operations worked, the embedding model dimension lookup failed silently, preventing codebase indexing.Solution
getModelDimension(),getModelScoreThreshold(), andgetModelQueryPrefix()inembeddingModels.tsto perform case-insensitive model ID matchingObject.keys().find()with.toLowerCase()for comparison while preserving original profile keysTesting
embeddingModels.spec.tswith 22 testsImpact
Fixes #9026
Feedback and testing welcome! This should resolve the indexing issue, but if the problem persists, there may be additional factors to investigate.
Important
This PR makes model ID matching case-insensitive in
embeddingModels.tsto fix indexing issues with custom providers, adding comprehensive tests for validation.getModelDimension(),getModelScoreThreshold(), andgetModelQueryPrefix()inembeddingModels.tsnow perform case-insensitive model ID matching using.toLowerCase().Object.keys().find()to preserve original profile keys.embeddingModels.spec.tsto cover case-insensitive matching for all three functions.This description was created by
for 96dabb5. You can customize this summary. It will automatically update as commits are pushed.