-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add runtime indexing state check to codebase_search tool (#5662) #5894
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: add runtime indexing state check to codebase_search tool (#5662) #5894
Conversation
…eInc#5662) - Check if indexing is complete (state === 'Indexed') before searching - Provide clear error message with current indexing state - Guide users to use alternative tools while indexing - Add comprehensive test coverage for all indexing states This ensures semantic search is only used when the index is ready, preventing confusion and failed search attempts during indexing.
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I think this should be handled differently. We should distinguish between the initial full-codebase scan and the file watcher indexing state. That way, file changes don’t end up disabling the tool. If indexing is enabled but not ready, we should show a warning to the user. The tool should also be excluded from the system prompt until it's fully ready. |
Related GitHub Issue
Closes: #5662
Roo Code Task Context (Optional)
No Roo Code task context for this PR
Description
This PR implements a runtime check for the indexing state in the
codebase_searchtool, as suggested by @daniel-lxs in the issue comments. Instead of hiding the tool from the tool list when indexing is not complete (as attempted in PR #5663), this solution:codebase_searchtool always available in the tool listThe key implementation detail is the addition of a state check before executing the search:
This approach provides better user experience by:
Test Procedure
Unit Tests:
src/core/tools/__tests__/codebaseSearchTool.spec.tsManual Testing Steps:
codebase_search- should get "disabled" errorcodebase_search- should get "currently Indexing" errorcodebase_search- should work normallyTo run the tests:
Pre-Submission Checklist
Screenshots / Videos
No UI changes in this PR
Documentation Updates
Additional Notes
This implementation follows the suggestion from @daniel-lxs in the issue comments, which provides a better user experience than the approach in PR #5663. The error messages are designed to be informative and guide users to alternative solutions while waiting for indexing to complete.
Get in Touch
Discord username not provided
Important
Adds runtime indexing state check to
codebaseSearchTooland comprehensive tests for various states and configurations.codebaseSearchToolto ensure indexing state is 'Indexed' before proceeding.codebase_searchtool available in tool list regardless of indexing state.codebaseSearchTool.spec.tswith tests for indexing states: 'Standby', 'Indexing', 'Error', and 'Indexed'.This description was created by
for 8bd4fc5. You can customize this summary. It will automatically update as commits are pushed.