Skip to content

fix: respect user-configured dimensions setting in file index #5755

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Jul 15, 2025

Fixes #5754

Problem

RooCode was ignoring the dimensions setting in the file index configuration. When users configured the system to use 1536 dimensions, it would still try to use 1024 dimensions, causing a vector dimension error in Qdrant: "Vector dimension error: expected dim: 1536, got 1024".

Root Cause

The issue was in src/core/webview/ClineProvider.ts at line 1545, where there was a hardcoded fallback value of 1536 for the dimension setting:

codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension ?? 1536,

This hardcoded fallback was overriding the proper dimension resolution logic in the service factory.

Solution

Removed the hardcoded ?? 1536 fallback to allow the proper dimension resolution hierarchy to work:

  1. User configuration (modelDimension from config)
  2. Model-specific defaults (getModelDimension() from embedding model profiles)
  3. System defaults (handled by service factory)

Changes

  • src/core/webview/ClineProvider.ts: Removed hardcoded 1536 dimension fallback on line 1545

Testing

  • ✅ TypeScript compilation passes
  • ✅ All code-index service factory tests pass (37/37)
  • ✅ All embedder tests pass (103/103)
  • ✅ Linting passes

Technical Details

The system has a sophisticated dimension handling mechanism:

  • Built-in model profiles with predefined dimensions (e.g., "text-embedding-3-small": 1536, "mxbai-embed-large": 1024)
  • Custom dimension configuration as fallback
  • Service factory that resolves the final dimension
  • Vector store initialization that validates dimensions

The fix ensures that user-configured dimensions are properly respected by allowing the dimension resolution to follow the proper hierarchy instead of being overridden by a hardcoded value.


Important

Removed hardcoded dimension fallback in ClineProvider.ts to respect user-configured settings.

  • Behavior:
    • Removed hardcoded fallback of 1536 dimensions in ClineProvider.ts to respect user-configured dimensions.
  • Technical Details:
    • Ensures dimension resolution hierarchy: user configuration, model-specific defaults, system defaults.

This description was created by Ellipsis for 609638b. You can customize this summary. It will automatically update as commits are pushed.

- Remove hardcoded 1536 dimension fallback in ClineProvider.ts line 1545
- Allow proper dimension resolution through service factory hierarchy:
  1. User configuration (modelDimension)
  2. Model-specific defaults (getModelDimension)
  3. System defaults
- Fixes issue where RooCode ignored dimensions setting and caused
  "Vector dimension error: expected dim: 1536, got 1024" in Qdrant

Fixes #5754
@roomote roomote bot requested review from mrubens, cte and jr as code owners July 15, 2025 19:17
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 15, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 15, 2025
@daniel-lxs daniel-lxs moved this from Triage to Roomote/renovate BOT in Roo Code Roadmap Jul 15, 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 Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Roomote/renovate BOT
Development

Successfully merging this pull request may close these issues.

RooCode ignores dimensions setting in file index.
2 participants