Roo-Code/src
roomote[bot] 2b647ed9a1
fix: handle current directory path "." correctly in codebase_search tool (#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

Fixes #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 <roomote@roocode.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: hannesrudolph <hrudolph@gmail.com>
2025-08-06 06:28:28 -07:00
..
__mocks__ feature: add toggle for disable mcp server tool from prompt (#3551) 2025-06-20 19:14:59 -04:00
__tests__ Skip interpolation for non-existent slash commands (#6475) 2025-07-31 01:21:19 -04:00
activate feat: code indexing support multiple folder similar with task history (#6204) 2025-08-04 19:39:37 -07:00
api feat: reduce Gemini 2.5 Pro minimum thinking budget to 128 (#6588) 2025-08-05 15:43:20 -07:00
assets PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
core fix: recover from error state when Qdrant becomes available (#6661) 2025-08-06 06:26:34 -07:00
extension Task and TaskProvider event emitter cleanup + a few new events (#6606) 2025-08-02 11:12:44 -07:00
i18n fix: improve handling of net::ERR_ABORTED errors in URL fetching (#6635) 2025-08-05 14:21:58 -07:00
integrations fix: improve Claude Code ENOENT error handling with installation guidance (#5867) 2025-07-31 10:45:16 -04:00
services fix: handle current directory path "." correctly in codebase_search tool (#6517) 2025-08-06 06:28:28 -07:00
shared feat: reduce Gemini 2.5 Pro minimum thinking budget to 128 (#6588) 2025-08-05 15:43:20 -07:00
utils Revert "Extension bridge (#6677)" (#6729) 2025-08-05 10:45:45 -07:00
workers Count tokens worker (#3037) 2025-04-29 12:29:25 -07:00
.gitignore PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
.prettierignore PNPM + Turbo monorepo + Nightly releases (#3407) 2025-05-21 21:01:20 -07:00
.vscodeignore debug: Add ErrorBoundary component for better error handling (#5085) 2025-07-23 08:45:35 -04:00
esbuild.mjs Revert "fix: optimize README for VS Code marketplace to prevent UI freezing" (#6303) 2025-07-28 14:31:01 -04:00
eslint.config.mjs Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
extension.ts Revert "Use @roo-code/cloud from npm" (#6742) 2025-08-05 16:13:11 -10:00
package.json Revert "Use @roo-code/cloud from npm" (#6742) 2025-08-05 16:13:11 -10:00
package.nls.ca.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.de.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.es.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.fr.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.hi.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.id.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.it.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.ja.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.ko.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.nl.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.pl.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.pt-BR.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.ru.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.tr.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.vi.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.zh-CN.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
package.nls.zh-TW.json Remove "(prev Roo Cline)" from extension title in all languages (#6426) 2025-07-30 09:06:44 -04:00
tsconfig.json fix typescript compiler watch path inconsistency (#5155) 2025-07-08 10:40:01 -04:00
turbo.json Improve turbo task dependency declarations (#4323) 2025-06-04 09:32:27 -07:00
vitest.config.ts Fix #4958: Increase vitest timeout for Windows CI (#4959) 2025-06-20 17:14:42 -07:00
vitest.setup.ts Farewell jest (#4607) 2025-06-16 21:39:45 -07:00