Skip to content

Conversation

@yavpungggi
Copy link

@yavpungggi yavpungggi commented Oct 10, 2025

Related GitHub Issue

Closes: #8600

Description

This PR fixes the indexer to work correctly when the workspace is located under hidden parent directories (e.g., .root, .config).

The Problem:
Both scanner.ts and file-watcher.ts were using absolute file paths when checking isPathInIgnoredDirectory(), causing the entire workspace to be filtered out if any parent directory started with a dot.

The Solution:

  • Modified both files to use relative paths (relative to workspace root) instead of absolute paths when checking for ignored directories
  • Moved relativeFilePath calculation earlier in file-watcher.ts to use it for the ignore check
  • Added explanatory comments to clarify why relative paths are used

Test Procedure

Manual Testing:

  1. Place workspace under a hidden parent directory (e.g., C:\Users\username.root\Roo-Code)
  2. Start indexing via Roo Code extension
  3. Verify Qdrant collection is created and points are added
  4. Create/modify a file in the workspace
  5. Verify file watcher automatically indexes the changes

Verification:
Reviewers can test by cloning the repo into a directory like .test/project and running "Start indexing" - points should be created successfully.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Important

Use relative paths in file-watcher.ts and scanner.ts to prevent filtering out workspaces under hidden directories.

  • Behavior:
    • Use relative paths in isPathInIgnoredDirectory() in file-watcher.ts and scanner.ts to prevent filtering out workspaces under hidden directories.
    • Move relativeFilePath calculation earlier in file-watcher.ts for ignore checks.
  • Comments:
    • Add comments explaining the use of relative paths to avoid filtering issues.

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

…g workspaces under hidden parent directories

- Modified scanner.ts to use relativeFilePath instead of filePath when checking isPathInIgnoredDirectory

- Modified file-watcher.ts to calculate relativeFilePath earlier and use it for isPathInIgnoredDirectory check

- This prevents workspaces located under hidden parent directories (e.g., .root) from being incorrectly filtered out during both initial indexing and file watching

- Ensures both initial indexing and incremental updates work correctly for all workspace locations
@yavpungggi yavpungggi requested review from cte, jr and mrubens as code owners October 10, 2025 15:24
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Oct 10, 2025
Copy link

@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 correctly addresses the issue by using relative paths instead of absolute paths when checking for ignored directories. This prevents workspaces under hidden parent directories from being filtered out. However, there's a gap in test coverage for this specific scenario.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 10, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Oct 10, 2025
Copy link

@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 correctly addresses the issue by using relative paths when checking for ignored directories. However, there's a critical test failure that needs to be fixed before merging.

Copy link

@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.

All previous review comments have been successfully addressed. The fix correctly uses relative paths to prevent filtering out workspaces under hidden parent directories, and comprehensive test coverage has been added.

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Oct 28, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Oct 29, 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 PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: PR [Needs Prelim Review]

Development

Successfully merging this pull request may close these issues.

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

2 participants