Skip to content

[ENHANCEMENT] feat: Per-workspace indexing opt-in and stop/cancel indexing controls #11455

@JamesRobert20

Description

@JamesRobert20

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)

  1. 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.

  2. 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.

  3. Disabling the global "Enable Codebase Indexing" toggle should immediately stop any in-progress scan, not just the file watcher.

Constraints / preferences (optional)

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions