You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2026. It is now read-only.
Indexing fails after switching vector model dimensions due to dimension mismatch error #5616
Description
When switching between vector models with different dimensions in Roo Code (e.g., first using a 2048-dimensional model to generate an index, then switching to Google Gemini’s 768-dimensional model), re-indexing fails. The Qdrant database logs repeatedly show the error: “Vector dimension error: expected dim: 2048, got 768”, preventing successful codebase indexing. This issue is consistently reproducible.
Steps to Reproduce
In Roo Code settings, select a high-dimensional vector model (e.g., 2048 dimensions) and complete codebase indexing (status becomes green “Indexed”).
Navigate to Roo Code’s “Codebase Indexing” configuration, switch to a model with a different dimension (e.g., Google Gemini, 768 dimensions), and click “Save and Start Indexing”.
Observe behavior: Indexing fails, status turns red “Error”, and Qdrant logs show the dimension mismatch error:
Failed to update shard ws-dac1ca8e499c3b3c:0 on peer 5413442089717253, error: Wrong input: Vector dimension error: expected dim: 2048, got 768
Repeated attempts to re-index (via “Save and Start Indexing”) do not resolve the error, and indexing remains unsuccessful.
💥 Outcome Summary
Indexing fails after switching vector model dimensions due to dimension mismatch error
This error happens because Qdrant requires all vectors in a collection to have the same dimension. When you switch embedding models in Roo Code (for example, from a 2048-dimensional model to Google Gemini’s 768-dimensional model), the existing Qdrant collection still expects vectors of the old dimension, so new vectors with a different dimension cause a hard failure. The Roo Code docs confirm that changing the embedding model’s dimension requires a full re-index, but they don’t specify whether Roo Code automatically resets or recreates the Qdrant collection when you switch models—so the old collection may persist and block re-indexing with the new dimension source.
To resolve this, you’ll likely need to manually delete or reset the Qdrant collection before re-indexing with the new model. There’s no documented UI or CLI option in Roo Code for this, so you may need to use Qdrant’s management tools or API to drop the collection associated with your codebase, then trigger indexing again. If Roo Code adds automation for this in the future, it should be reflected in the docs, but for now, manual intervention is probably required.
This error happens because Qdrant requires all vectors in a collection to have the same dimension. When you switch embedding models in Roo Code (for example, from a 2048-dimensional model to Google Gemini’s 768-dimensional model), the existing Qdrant collection still expects vectors of the old dimension, so new vectors with a different dimension cause a hard failure. The Roo Code docs confirm that changing the embedding model’s dimension requires a full re-index, but they don’t specify whether Roo Code automatically resets or recreates the Qdrant collection when you switch models—so the old collection may persist and block re-indexing with the new dimension source.
To resolve this, you’ll likely need to manually delete or reset the Qdrant collection before re-indexing with the new model. There’s no documented UI or CLI option in Roo Code for this, so you may need to use Qdrant’s management tools or API to drop the collection associated with your codebase, then trigger indexing again. If Roo Code adds automation for this in the future, it should be reflected in the docs, but for now, manual intervention is probably required.
Currently, clicking "reset" in the settings allows me to resolve this issue. However, performing a full reset of Roo Code is not a very ideal solution.
I am able to reproduce this with the latest qdrant version after manually adjusting the model size without changing any other indexing settings. Not only that, but completely wiping the volume still throws this message.
Activity
dosubot commentedon Jul 12, 2025
This error happens because Qdrant requires all vectors in a collection to have the same dimension. When you switch embedding models in Roo Code (for example, from a 2048-dimensional model to Google Gemini’s 768-dimensional model), the existing Qdrant collection still expects vectors of the old dimension, so new vectors with a different dimension cause a hard failure. The Roo Code docs confirm that changing the embedding model’s dimension requires a full re-index, but they don’t specify whether Roo Code automatically resets or recreates the Qdrant collection when you switch models—so the old collection may persist and block re-indexing with the new dimension source.
To resolve this, you’ll likely need to manually delete or reset the Qdrant collection before re-indexing with the new model. There’s no documented UI or CLI option in Roo Code for this, so you may need to use Qdrant’s management tools or API to drop the collection associated with your codebase, then trigger indexing again. If Roo Code adds automation for this in the future, it should be reflected in the docs, but for now, manual intervention is probably required.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
hubeizys commentedon Jul 12, 2025
Currently, clicking "reset" in the settings allows me to resolve this issue. However, performing a full reset of Roo Code is not a very ideal solution.
fix: resolve vector dimension mismatch error when switching embedding…
roomote commentedon Jul 12, 2025
PR #5617 has been created to address this issue: #5617
roomote commentedon Jul 12, 2025
Status Update
The vector dimension mismatch issue has been successfully resolved in PR #5617.
✅ Solution Implemented
The fix automatically detects when there's a vector dimension mismatch between the existing Qdrant collection and the new embedding model, then:
🔧 Technical Details
src/services/code-index/vector-store/qdrant-client.tslines 162-179🧪 Testing Status
📋 Next Steps
The PR is ready for review and merge. The failing integration test is unrelated to this fix and affects the entire repository, not just this PR.
No more manual Qdrant collection deletion required! 🎉
fix: resolve vector dimension mismatch error when switching embedding…
fix: resolve vector dimension mismatch error when switching embedding…
Merge branch 'main' into gemini-cli
bqback commentedon Mar 31, 2026
I am able to reproduce this with the latest qdrant version after manually adjusting the model size without changing any other indexing settings. Not only that, but completely wiping the volume still throws this message.