Skip to content

search_files tool may return empty result if rg encounters file access errors during searchΒ #6756

@R-omk

Description

@R-omk

App Version

3.25.7

API Provider

Not Applicable / Other

Model Used

N/A

Roo Code Task Links (Optional)

No response

πŸ” Steps to Reproduce

remove user access (sudo chown) for some dirs/files in workspace.

πŸ’₯ Outcome Summary

Solution: We need to ignore file access errors by adding the --no-messages option to rg command.

rg help output:

--no-messages
    Suppress all error messages related to opening and reading files. Error
    messages related to the syntax of the pattern given are still shown.
    This flag can be disabled with the --messages flag.

const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", directoryPath]

πŸ“„ Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions