-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: respect UI-configured dimension settings for code indexing #7283
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
Conversation
- Remove hardcoded 1536 fallback in getStateToPostToWebview() - Remove hardcoded fallback in getState() - Allow undefined dimension to flow through to service layer - Service layer properly resolves dimension from model profiles or user config Fixes #5754
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own code is like looking in a mirror and realizing I forgot to check half the locations I mentioned.
| codebaseIndexEmbedderBaseUrl: codebaseIndexConfig?.codebaseIndexEmbedderBaseUrl ?? "", | ||
| codebaseIndexEmbedderModelId: codebaseIndexConfig?.codebaseIndexEmbedderModelId ?? "", | ||
| codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension ?? 1536, | ||
| codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch removing this hardcoded fallback! This was indeed preventing the UI-configured dimension from being used. However, I notice the PR description mentions TWO locations (line 1870 and lines 2059-2060), but I only see one change here. Did I miss updating the second location in the getState() method around line 2060?
| codebaseIndexEmbedderBaseUrl: codebaseIndexConfig?.codebaseIndexEmbedderBaseUrl ?? "", | ||
| codebaseIndexEmbedderModelId: codebaseIndexConfig?.codebaseIndexEmbedderModelId ?? "", | ||
| codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension ?? 1536, | ||
| codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're now allowing undefined to flow through, we should verify that the service layer properly handles this case. Looking at config-manager.ts and service-factory.ts, it appears the dimension resolution hierarchy is:
- User-configured dimension from UI
- Model-specific dimension from embedding profiles
- Error if no dimension can be determined
Could we add a test to ensure this hierarchy works correctly?
Description
This PR fixes issue #5754 where RooCode was ignoring the dimension settings configured in the UI when creating file index collections.
Problem
The issue was that hardcoded fallback values (1536) in
ClineProvider.tswere overriding undefined dimension values, preventing the proper dimension resolution logic in the service layer from working correctly.Solution
Removed the hardcoded fallbacks in two locations:
getStateToPostToWebview()methodgetState()methodNow the dimension value flows through as undefined when not explicitly set, allowing the service layer to properly resolve it using this hierarchy:
Testing
Related Issue
Fixes #5754
Notes for Reviewers
@jhstatewide - This fix ensures that when you configure a dimension in the UI settings, it will be properly used when creating the Qdrant collection. The service layer (
config-manager.tsandservice-factory.ts) already has the correct logic to handle dimension resolution - the issue was just that the hardcoded fallback was preventing undefined values from reaching that logic.If you still experience issues after this fix, please let me know with details about:
Important
Remove hardcoded dimension fallback in
ClineProvider.tsto respect UI-configured settings for code indexing.getStateToPostToWebview()andgetState()inClineProvider.ts.This description was created by
for 104dbdb. You can customize this summary. It will automatically update as commits are pushed.