Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 4, 2025

This PR fixes an issue where users could not disable codebase indexing when no workspace folder was open.

Problem

  • When trying to disable codebase indexing without an open workspace, the settings would not save
  • An error message "Error - Indexing requires an open workspace folder" would persist
  • The UI would not update to reflect that indexing was disabled

Solution

  • Modified the saveCodeIndexSettingsAtomic handler to allow saving settings when disabling the feature, regardless of workspace availability
  • Updated requestIndexingStatus, startIndexing, and clearIndexData handlers to only show workspace-required errors when the feature is enabled
  • Clear error status when the feature is disabled to prevent persistent error messages

Testing

  • Tested disabling codebase indexing without a workspace - settings now save correctly
  • Tested enabling codebase indexing without a workspace - appropriate error is shown
  • All existing tests pass

Fixes #6664


Important

Fixes issue allowing codebase indexing to be disabled without an open workspace by updating relevant handlers to save settings and manage error messages correctly.

  • Behavior:
    • saveCodeIndexSettingsAtomic now allows saving settings when disabling codebase indexing without a workspace.
    • requestIndexingStatus, startIndexing, and clearIndexData handlers updated to show workspace-required errors only when indexing is enabled.
    • Clears error status when indexing is disabled to prevent persistent error messages.
  • Testing:
    • Verified disabling codebase indexing without a workspace saves settings correctly.
    • Verified enabling indexing without a workspace shows appropriate error.
    • All existing tests pass.

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

- Modified saveCodeIndexSettingsAtomic handler to allow saving settings when disabling the feature without a workspace
- Updated requestIndexingStatus, startIndexing, and clearIndexData handlers to only show workspace errors when the feature is enabled
- Clear error status when disabling the feature to prevent persistent error messages

Fixes #6664
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 4, 2025 16:16
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Aug 4, 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.

I reviewed my own code and found it surprisingly coherent. Must be a bug in my review algorithm.

Review Summary

The PR successfully fixes the issue where users couldn't disable codebase indexing without a workspace folder open. The implementation is sound - settings are saved first, then the code checks if the feature is being disabled before requiring a workspace.

Suggestions for Improvement

  1. Missing test coverage - The PR modifies three message handlers but doesn't include tests. Given the complexity of the state management, tests would help ensure the fix works correctly in all scenarios.

  2. Code duplication - The pattern of checking if the feature is enabled and showing appropriate status is repeated across handlers. Consider extracting this into a shared utility function.

  3. Error status clearing - The pattern of clearing error status by sending a "Standby" status could be extracted into a helper function.

  4. Potential race condition - The 200ms delay before auto-starting indexing might not be sufficient in all cases. Consider using a debounce mechanism.

  5. Minor: Error message consistency - Some error logs include "while disabling" context while others don't.

Overall, the fix addresses the reported issue effectively. The suggestions above would improve maintainability and robustness.

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

Closing in favor of #6661

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

Labels

bug Something isn't working 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.

Codebase indexing error state and inability to save settings

4 participants