Skip to content

[bug] Repository filtering (filterByRepos) not working in search_code tool #990

@manu-krish-zp

Description

@manu-krish-zp

Describe the bug

The filterByRepos parameter in the code search tool doesn't filter results correctly when repository names contain special characters like dots (.), dashes (-), or slashes (/). When attempting to search within a specific repository, the search returns "No results found" even when the searched content clearly exists in that repository.

The error message reveals that these special characters are being escaped (e.g., dev.azure.com becomes dev.azure.com, and my-backend-service becomes my\x2dbackend\x2dservice).

To reproduce

Use the search_code tool without any repository filter - observe that results are returned successfully
Use the same search query but add a filterByRepos parameter with a repository name containing dots, dashes, or slashes (e.g., dev.azure.com/OrgName/ProjectName/_git/my-backend-service)
Observe that the search now returns "No results found" despite the same content being present

Example:

Search query: "NotificationAPIClient"
Without filter: Returns 7 matches across 6 files
With filterByRepos: ["dev.azure.com/OrgName/ProjectName/_git/my-backend-service"]: Returns "No results found"

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1): v4.11.4

Additional information

The error message shows repository names with escaped characters (e.g., dev.azure.com, my\x2dbackend\x2dservice)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions