Skip to content

Indexing fails after switching vector model dimensions due to dimension mismatch error #5616

@hubeizys

Description

@hubeizys

App Version

3.23.7

API Provider

Google Gemini

Model Used

text-embedding-004

Roo Code Task Links (Optional)

No response

🔁 Steps to Reproduce

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

📄 Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions