Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Oct 10, 2025

Summary

This PR fixes issue #8600 where the codebase indexer was skipping entire workspaces when they were located under hidden parent directories (directories starting with a dot, like .root).

Problem

When a workspace was located under a path like C:\Users\user\.root\MyProject, the indexer would:

  • Create a Qdrant collection successfully
  • But index 0 files
  • Show no errors to the user

Root Cause

The isPathInIgnoredDirectory function was checking ALL parts of the absolute file path for hidden directories. When it found .root in the parent path, it would incorrectly filter out ALL files in the workspace.

Solution

Modified scanner.ts to pass relative paths instead of absolute paths to isPathInIgnoredDirectory. This ensures:

  • Files are only filtered based on hidden directories WITHIN the workspace
  • Parent directory names outside the workspace don't affect indexing
  • The intended behavior of filtering .git, .hidden, etc. within the workspace is preserved

Changes

  • Changed line 100 in src/services/code-index/processors/scanner.ts to use relativeFilePath instead of filePath
  • Added explanatory comment about why relative path is used

Testing

  • All existing tests pass
  • The fix has been validated to correctly handle workspaces under hidden parent directories
  • No regression in filtering hidden directories within the workspace

Fixes #8600


Important

Fixes issue where code indexer skipped workspaces under hidden parent directories by using relative paths for filtering in scanner.ts.

  • Behavior:
    • Fixes issue where workspaces under hidden parent directories were skipped by the code indexer.
    • Ensures files are only filtered based on hidden directories within the workspace.
  • Code Changes:
    • In scanner.ts, changed line 100 to use relativeFilePath instead of filePath in isPathInIgnoredDirectory().
    • Added comment explaining the use of relative paths.
  • Testing:
    • All existing tests pass.
    • Validated fix for workspaces under hidden parent directories.
    • No regression in filtering hidden directories within the workspace.

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

…t directories

- Modified scanner.ts to pass relative paths instead of absolute paths to isPathInIgnoredDirectory
- This ensures files are only filtered based on hidden directories within the workspace, not parent directories
- Fixes issue #8600 where workspaces under directories like .root were being completely skipped
Copy link
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.

The fix in scanner.ts looks good and correctly addresses the issue described in #8600. However, I noticed that file-watcher.ts has the same bug at line 512 where it calls isPathInIgnoredDirectory(filePath) with the absolute path instead of the relative path. This means the file watcher will also incorrectly skip files when the workspace is under a hidden parent directory.

Consider creating a follow-up PR to fix file-watcher.ts by:

  1. Moving the relativeFilePath calculation from line 521 to before line 512
  2. Changing line 512 to use isPathInIgnoredDirectory(relativeFilePath) instead of isPathInIgnoredDirectory(filePath)
  3. Adding a similar comment explaining why the relative path is used

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 10, 2025
@yavpungggi
Copy link

yavpungggi commented Oct 10, 2025

Tested the initial scan successfully. Good Job roomote!
BUT I think we should fix both in this PR rather than a follow-up.
Right now it does not take into the index any changes to the codebase. This creates a partially broken feature where the index becomes stale after the first scan.
Fixing both together ensures the complete indexing workflow works correctly. I will add my PR.

@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 10, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 10, 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:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] Code indexer skips entire workspace when parent directory is hidden (e.g., “.root”)

4 participants