Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 30, 2025

Implements workspace-specific storage for index settings to fix issue #6406.

Key changes:

  • Extended ContextProxy with workspace storage methods
  • Updated CodeIndexConfigManager to use workspace storage
  • Added automatic migration from global to workspace settings
  • Updated webview message handler for per-workspace saving
  • Added comprehensive tests for new functionality

This allows different workspaces to have different vector database configurations, which is especially useful when switching between local development and dev containers.

Fixes #6406


Important

Implements workspace-specific storage for index settings, enabling distinct configurations per workspace and automatic migration from global settings.

  • Behavior:
    • Implements workspace-specific storage for index settings in ContextProxy and CodeIndexConfigManager.
    • Adds automatic migration from global to workspace settings if workspace settings are absent.
    • Updates webviewMessageHandler to handle per-workspace saving of settings.
  • Tests:
    • Adds tests in config-manager.spec.ts to verify workspace-specific storage, migration, and preference over global settings.
  • Misc:

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

- Add workspace storage methods to ContextProxy
- Update CodeIndexConfigManager to use workspace storage instead of global
- Add migration logic to move existing global settings to workspace
- Update webview message handler to save settings per workspace
- Add comprehensive tests for workspace-specific storage functionality

Fixes #6406
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 30, 2025 02:21
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 30, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This PR successfully implements workspace-specific storage for index settings, addressing issue #6406. The implementation includes proper migration from global to workspace settings and comprehensive test coverage.

Critical Issues (Must Fix):

  1. Missing error handling in ContextProxy.updateWorkspaceState() - The method at lines 143-145 in src/core/config/ContextProxy.ts doesn't handle potential failures. Could this fail silently if workspace state update fails?

Important Suggestions (Should Consider):

  1. Inconsistent migration behavior - In src/services/code-index/config-manager.ts lines 47-53, the migration from global to workspace happens every time workspace config is missing. Should this be a one-time operation instead?

  2. Potential race condition - In src/core/webview/webviewMessageHandler.ts lines 1993-2012, the workspace state read and write operations aren't atomic, which could lead to data loss if multiple saves happen concurrently.

  3. Test coverage gap - The new workspace storage methods in ContextProxy.ts (lines 136-145) lack direct unit tests, only integration tests exist.

Minor Improvements (Nice to Have):

  1. Code duplication - The default configuration object in src/services/code-index/config-manager.ts lines 56-65 is duplicated and could be extracted to a constant.

  2. Missing JSDoc documentation - The new workspace methods in ContextProxy.ts would benefit from JSDoc comments for better API discoverability.

Positive Notes:

  • Excellent test coverage for the workspace-specific functionality
  • Clean migration strategy from global to workspace settings
  • Proper handling of fallback scenarios
  • Implementation correctly addresses the user's need for different configurations per workspace

Overall, this is a solid implementation that solves the core issue effectively. The critical error handling issue should be addressed, but the functionality works as intended.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 30, 2025
@daniel-lxs
Copy link
Member

Closing, see #6406 (comment)

@daniel-lxs daniel-lxs closed this Jul 31, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 31, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Index settings do save based on workspace setting

4 participants