You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: handle current directory path "." correctly in codebase_search tool (RooCodeInc#6517)
* fix: handle current directory path "." correctly in codebase_search tool
- Fix path filtering logic in QdrantVectorStore.search() to properly handle current directory representations
- When directoryPrefix is ".", "./", "", or similar, set filter to undefined to search entire workspace
- Add comprehensive tests covering various current directory path formats including cross-platform support
- Resolves issue where codebase_search with path="." returned no results
FixesRooCodeInc#6514
* fix: normalize directory prefix handling in Qdrant vector store
* fix: normalize paths starting with './' and fix OS-dependency issue
- Use forward slash for splitting after toPosix() conversion
- Remove leading './' from paths like './src' to normalize them to 'src'
- Update test expectations to match correct behavior
* refactor: use path.posix.normalize instead of custom toPosix method
- Replaced directoryPrefix.toPosix() with path.posix.normalize()
- Added proper handling of backslashes before normalization
- Updated test mock to include posix.normalize method
- All tests passing (381 tests in code-index service)
* refactor: address review comments - improve path normalization
- Keep check for './' after normalization as path.posix.normalize('./') returns './'
- Use actual Node.js path.posix implementation in tests instead of custom mock
- Apply path.posix.normalize to cleanedPrefix for consistency
All 381 code-index tests pass
* fix: apply path.posix.normalize when cleaning prefix to avoid redundant normalization
Addresses review comment from @mrubens to normalize the path at line 385 instead of normalizing twice
* fix: correct current directory detection logic
The issue was that the condition checked for an empty string after normalization,
but path.posix.normalize('') actually returns '.', not ''. This caused the
current directory check to fail when an empty string was passed.
Removed the redundant empty string check since normalize('') returns '.' which
is already handled by the first condition.
---------
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Daniel Riccio <[email protected]>
Co-authored-by: hannesrudolph <[email protected]>
0 commit comments