Skip to content

feat: per-workspace codebase indexing configuration#11948

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/per-workspace-codebase-index-config
Draft

feat: per-workspace codebase indexing configuration#11948
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/per-workspace-codebase-index-config

Conversation

@roomote-v0
Copy link
Contributor

@roomote-v0 roomote-v0 bot commented Mar 17, 2026

Related GitHub Issue

Closes: #11947

Description

This PR attempts to address Issue #11947 by adding per-workspace codebase indexing configuration support. Currently, codebase indexing settings (embedder provider, model, Qdrant URL, API keys, search thresholds) are stored globally and shared across all workspaces. This change introduces an optional per-workspace configuration override while keeping the global config as the default fallback.

Key implementation details:

  • CodeIndexConfigManager: Added a WorkspaceConfigResolver parameter that lazily resolves workspace-specific config and secrets. When provided and returning a value, it takes priority over global config.
  • CodeIndexManager: Added workspace config management methods (useWorkspaceConfig, saveWorkspaceConfig, saveWorkspaceSecrets, getEffectiveConfig) stored in workspaceState keyed by folder URI. When workspace config is first enabled, global config is copied as the starting point.
  • webviewMessageHandler: The saveCodeIndexSettingsAtomic handler now checks for useWorkspaceConfig flag to route saves to workspace or global storage. A new setUseWorkspaceConfig handler toggles the feature.
  • ClineProvider: getStateToPostToWebview() now sends the effective config (workspace-specific or global) so the UI displays the correct settings.
  • UI: Added a "Use workspace-specific settings" checkbox in the CodeIndexPopover, with an indicator when workspace config is active.

Design trade-offs:

  • Workspace-specific secrets are stored in workspaceState rather than the VS Code secret store, since the secret store does not support per-workspace scoping. This is acceptable for local-only storage.
  • The feature is fully opt-in and backwards compatible -- existing global config continues to work unchanged.

Feedback and guidance are welcome.

Test Procedure

  • All 467 existing code-index tests pass (21 test files)
  • All linting and type-checking passes
  • Manual testing: toggle "Use workspace-specific settings" in the Code Index popover, verify settings are saved per-workspace and persist across reloads

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue.
  • Self-Review: Performed thorough self-review.
  • Testing: Existing tests pass; additional tests for workspace config resolution could be added.
  • Documentation Impact: UI changes are self-documenting with translation strings.
  • Contribution Guidelines: Read and agree to the Contributor Guidelines.

Interactively review PR in Roo Code Cloud

Allow users to use workspace-specific settings for codebase indexing
instead of a single global configuration. Each project/workspace can
now have its own embedder provider, model, Qdrant URL, API keys, and
search settings.

Changes:
- CodeIndexConfigManager: accept optional WorkspaceConfigResolver to
  load workspace-specific config and secrets instead of global state
- CodeIndexManager: add useWorkspaceConfig toggle, workspace config
  storage methods, and effective config resolution
- webviewMessageHandler: route saves to workspace or global storage
  based on useWorkspaceConfig flag; add setUseWorkspaceConfig handler
- ClineProvider: send effective (workspace or global) config to webview
- Types: add useWorkspaceConfig to IndexingStatus and codeIndexSettings
- CodeIndexPopover: add "Use workspace-specific settings" toggle in UI
- English locale: add translation strings for new UI elements

Closes #11947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Want Codebase Indexing to be per project/workspace, not limited to global

1 participant