-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: resolve vector dimension mismatch error when switching embedding models (#5616) #5617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
|
✅ No security or compliance issues detected. Reviewed everything up to 15ec56a. Security Overview
Detected Code Changes
Reply to this PR with |
… models (#5616) - Enhanced QdrantVectorStore.initialize() with robust dimension mismatch handling - Added atomic collection recreation with step-by-step verification - Improved error reporting with detailed context for better user experience - Added comprehensive test coverage for all dimension mismatch scenarios - Fixes issue where switching from 2048-dim to 768-dim models would fail
5da7606 to
b8d4301
Compare
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
mrubens
approved these changes
Jul 14, 2025
fxcl
added a commit
to tameslabs/Roo-Cline
that referenced
this pull request
Jul 16, 2025
* main: fix: Resolve confusing auto-approve checkbox states (RooCodeInc#5602) fix: prevent empty mode names from being saved (RooCodeInc#5766) (RooCodeInc#5794) Format time in ISO 8601 (RooCodeInc#5793) fix: resolve DirectoryScanner memory leak and improve file limit handling (RooCodeInc#5785) Fix settings dirty check (RooCodeInc#5779) feat: increase Ollama API timeout values and extract as constants (RooCodeInc#5778) fix: Exclude Terraform and Terragrunt cache directories from checkpoints (RooCodeInc#4601) (RooCodeInc#5750) Move less commonly used provider settings into an advanced dropdown (RooCodeInc#5762) feat: Add configurable error & repetition limit with unified control (RooCodeInc#5654) (RooCodeInc#5752) list-files must include at least the first-level directory contents (RooCodeInc#5303) Update evals repo link (RooCodeInc#5758) Feature/vertex ai model name conversion (RooCodeInc#5728) fix(litellm): handle baseurl with paths correctly (RooCodeInc#5697) Add telemetry for todos (RooCodeInc#5746) feat: add undo functionality for enhance prompt feature (fixes RooCodeInc#5741) (RooCodeInc#5742) Fix max_tokens limit for moonshotai/kimi-k2-instruct on Groq (RooCodeInc#5740) Changeset version bump (RooCodeInc#5735) Add changeset for v3.23.12 patch release (RooCodeInc#5734) Update the max-token calculation in model-params to use the shared logic (RooCodeInc#5720) Changeset version bump (RooCodeInc#5719) chore: add changeset for v3.23.11 patch release (RooCodeInc#5718) Add Kimi K2 model and better support (RooCodeInc#5717) Fix: Remove invalid skip-checkout parameter from GitHub Actions workflows (RooCodeInc#5676) feat: add Cmd+Shift+. keyboard shortcut for previous mode switching (RooCodeInc#5695) Changeset version bump (RooCodeInc#5708) chore: add changeset for v3.23.10 patch release (RooCodeInc#5707) Add padding to the index model options (RooCodeInc#5706) fix: prioritize built-in model dimensions over custom dimensions (RooCodeInc#5705) Update CHANGELOG.md Changeset version bump (RooCodeInc#5702) chore: add changeset for v3.23.9 patch release (RooCodeInc#5701) Tweaks to command timeout error (RooCodeInc#5700) Update contributors list (RooCodeInc#5639) feat: enable Claude Code provider to run natively on Windows (RooCodeInc#5615) feat: Add configurable timeout for command execution (RooCodeInc#5668) feat: add gemini-embedding-001 model to code-index service (RooCodeInc#5698) fix: resolve vector dimension mismatch error when switching embedding models (RooCodeInc#5616) (RooCodeInc#5617) fix: [5424] return the cwd in the exec tool's response so that the model is not lost after subsequent calls (RooCodeInc#5667) Changeset version bump (RooCodeInc#5670) chore: add changeset for v3.23.8 patch release (RooCodeInc#5669)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
lgtm
This PR has been approved by a maintainer
PR - Needs Review
size:L
This PR changes 100-499 lines, ignoring generated files.
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.
Description
Fixes #5616
This PR resolves the vector dimension error that occurs when switching between embedding models with different vector dimensions (e.g., from 2048-dimension models to Google Gemini's 768-dimension model).
Problem
When users switched from a high-dimensional embedding model (2048 dimensions) to a lower-dimensional model like Google Gemini (768 dimensions), the Qdrant vector store would fail to recreate the collection, resulting in:
Solution
Enhanced the QdrantVectorStore with robust dimension mismatch handling:
Key Changes Made
Enhanced Collection Recreation Logic
Improved Error Reporting
causepropertyRobust Verification Process
Files Changed
src/services/code-index/vector-store/qdrant-client.ts- Enhanced collection recreation logicsrc/services/code-index/vector-store/__tests__/qdrant-client.spec.ts- Added comprehensive test coverageTesting
Verification of Acceptance Criteria
Impact
Checklist
Important
Fixes vector dimension mismatch in
QdrantVectorStoreby enhancing collection management and error handling.QdrantVectorStorewhen switching embedding models.qdrant-client.ts.qdrant-client.spec.tsfor dimension mismatch scenarios, including successful recreation and error handling.ClineProvider.tsto include new configuration options for embedding models.This description was created by
for e29f633. You can customize this summary. It will automatically update as commits are pushed.