-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Problem (one or two sentences)
Once a user enables codebase indexing globally, opening any other project automatically starts indexing it with no per-project control (same issue reported in #10569). Additionally, there is no way to stop indexing once it starts, and disabling the toggle while indexing is in progress does not actually stop the scan — the yellow pulsing indicator persists.
Context (who is affected and when)
Any user who uses codebase indexing across multiple workspaces. This is especially severe for multi-root workspaces with local LLM providers (as described in #10569 ). The issue occurs when:
- opening a new workspace after enabling indexing globally — it auto-indexes without consent,
- wanting to cancel a long-running indexing operation mid-scan, or
- toggling off "Enable Codebase Indexing" during active indexing and seeing the indicator persist.
Desired behavior (conceptual, not technical)
-
Indexing should be opt-in per workspace — opening a new project should NOT auto-start indexing. Users should see a clear toggle to enable indexing for the current workspace, and that choice should be remembered across sessions.
-
Users should be able to stop indexing at any time via a "Stop Indexing" button. The stop should be graceful, preserving any partial index data already collected.
-
Disabling the global "Enable Codebase Indexing" toggle should immediately stop any in-progress scan, not just the file watcher.
Constraints / preferences (optional)
- The per-workspace choice should persist across IDE restarts (stored in workspaceState)
- Stopping indexing should not clear partial index data — users can clear it separately
- The stop should be graceful (complete current file, don't corrupt data)
- Aligns with the "Enhanced User Experience" roadmap goal
- Related: [BUG] Disable automatic full-workspace indexing: Multi-Root Workspaces cause local LLM DoS/Timeouts #10569
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear context and impact
Roo Code Task Links (optional)
No response
Acceptance criteria (optional)
Given a user has codebase indexing enabled globally
When they open a new workspace for the first time
Then indexing should NOT auto-start
And a "Enable indexing for this workspace" toggle should be visible in the CodeIndex popover
Given indexing is in progress
When the user clicks "Stop Indexing"
Then the scan should stop gracefully at the next file/batch boundary
And the status should show "Stopping..." then transition to "Standby"
But partial index data should NOT be cleared
Given indexing is in progress
When the user disables the global "Enable Codebase Indexing" toggle
Then the active scan should be aborted (not just the file watcher)
And the status indicator should stop pulsing
Proposed approach (optional)
Per-workspace opt-in via a codeIndexWorkspaceEnabled flag in workspaceState (default: false), AbortController/AbortSignal threaded through the orchestrator → scanner pipeline for cancellation, new "Stopping" state for visual feedback, and fix handleSettingsChange() to properly abort active scans.
Trade-offs / risks (optional)
Existing users with indexing enabled will need to re-enable it per workspace after this change (default is off). This is intentional — the current behavior of auto-indexing every project is the problem being solved. This supersedes the scope of #10569 .