-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: handle codebase search indexing state properly (#5662) #6118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle codebase search indexing state properly (#5662) #6118
Conversation
- Always show codebase_search tool in the tool list - Add runtime state checking with user-friendly feedback - Provide clear messages for each indexing state (Standby, Indexing, Error) - Suggest alternative tools when semantic search is unavailable - Add comprehensive tests for the new behavior This ensures Roo doesn't try to use semantic search when indexing is incomplete and provides clear feedback to users about the current state.
- Added translations for codeIndex.errorState to all 17 language files - Ensures consistent error messaging across all supported languages
|
Hi @daniel-lxs, I've implemented all your suggestions:
All tests are passing and CI checks are green. Thanks for the great suggestions! |
- Updated tool availability logic to exclude codebase_search when state is not 'Indexed' - Added comprehensive tests for tool availability based on indexing state - Removed tests for runtime feedback since tool won't be available in non-indexed states - Addresses review feedback from @daniel-lxs
|
@MuriloFP I missed the fact that hiding the tool from the prompt when it's indexing will probably cause issues when files are changed and the service enters the "Indexing" state again, maybe we should introduce a new state so that we can differentiate between the initial scan and the indexing process that happened when a file is updated to prevent this. What you do you think? |
Related GitHub Issue
Closes: #5662
Roo Code Task Context (Optional)
No Roo Code task context for this PR
Description
This PR addresses the issue where Roo would sometimes try to use semantic search even when indexing wasn't complete. The solution implements runtime state checking as suggested by @daniel-lxs in the issue comments.
Key implementation details:
codebase_searchtool is now always included in the tool list instead of being hiddenDesign choice: Following the suggestion in the comments, I kept the tool always available and added runtime checks instead of hiding it. This makes state transitions smoother and helps users understand why semantic search isn't being used.
Test Procedure
Automated tests:
src/core/tools/__tests__/codebaseSearchTool.spec.tscd src && npx vitest run core/tools/__tests__/codebaseSearchTool.spec.tscd src && npx vitest run core/prompts/sections/__tests__/Manual testing:
Pre-Submission Checklist
Screenshots / Videos
No UI changes in this PR
Documentation Updates
Additional Notes
This implementation follows the approach suggested by @daniel-lxs in the issue comments. The tool remains available at all times but provides clear feedback about the indexing state, making the experience more transparent for users.
Get in Touch
@MuriloFP
Important
Improves
codebase_searchtool by adding runtime state checks for indexing, providing user feedback, and updating tests.codebase_searchtool now always included in tool list, with runtime state checks for user feedback.search-service.ts.codebaseSearchTool.spec.tsfor new state handling logic.index.tsto conditionally excludecodebase_searchbased on feature configuration.This description was created by
for 5ce9ea5. You can customize this summary. It will automatically update as commits are pushed.