-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: handle Qdrant vector dimension mismatch when switching embedding models (#5562) #5565
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
mrubens
merged 3 commits into
main
from
fix/issue-5562-qdrant-vector-dimension-mismatch
Jul 10, 2025
Merged
fix: handle Qdrant vector dimension mismatch when switching embedding models (#5562) #5565
mrubens
merged 3 commits into
main
from
fix/issue-5562-qdrant-vector-dimension-mismatch
Jul 10, 2025
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
… models (#5562) - Added specific error handling for vector dimension mismatches - Attempt to delete and recreate collection when dimensions change - Provide clear, internationalized error message if recreation fails - Added comprehensive test coverage for dimension mismatch scenarios - Updated all locale files with new error message translations
|
✅ No security or compliance issues detected. Reviewed everything up to 8903a7b. Security Overview
Detected Code Changes
Reply to this PR with |
- Use error.cause instead of string matching for vector dimension mismatch errors - Fix interpolation syntax in all translation files (single to double curly braces) - Update tests to check for error.cause property
d66c0fc to
8903a7b
Compare
mrubens
approved these changes
Jul 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
lgtm
This PR has been approved by a maintainer
PR - Draft / In Progress
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 #5562
This PR improves error handling when switching between embedding models with different vector dimensions in the Qdrant vector store. Previously, users would encounter unclear errors when the vector dimensions didn't match. Now, the system attempts to recreate the collection with the new dimensions and provides a clear, internationalized error message if the operation fails.
Changes Made
qdrant-client.tsto detect vector dimension mismatches during collection recreationembeddings:vectorStore.vectorDimensionMismatchTesting
qdrant-client.spec.tsfor:Verification of Acceptance Criteria
Checklist
Files Changed
src/services/code-index/vector-store/qdrant-client.ts- Enhanced error handling for dimension mismatchessrc/services/code-index/vector-store/__tests__/qdrant-client.spec.ts- Added comprehensive test coveragesrc/i18n/locales/*/embeddings.json- Added new error message translations for all supported languagesImportant
Enhances error handling for Qdrant vector dimension mismatches, adds internationalized error messages, and updates tests.
qdrant-client.tsfor vector dimension mismatches during collection recreation.vectorDimensionMismatcherror with original error as cause if recreation fails.vectorDimensionMismatcherror message toembeddings.jsonin multiple locales.qdrant-client.spec.tsfor dimension mismatch detection and error handling.This description was created by
for 8903a7b. You can customize this summary. It will automatically update as commits are pushed.