Skip to content

Commit d6bafce

Browse files
jsbattigclaude
andcommitted
fix: Set source_repo for single-repo searches + document noise filtering
Bug fix: - Single-repo searches now set source_repo field (was null) - Ensures consistency with omni-search results Documentation: - Add NOISE FILTERING section with common exclude_path patterns - Enhance exclude_path parameter with practical examples - Patterns: package-lock.json, yarn.lock, node_modules, test fixtures 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 6a30dc4 commit d6bafce

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/code_indexer/server/mcp/handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ async def search_code(params: Dict[str, Any], user: User) -> Dict[str, Any]:
594594
response_results = []
595595
for r in results:
596596
result_dict = r.to_dict()
597+
result_dict["source_repo"] = (
598+
repository_alias # Fix: Set source_repo for single-repo searches
599+
)
597600
response_results.append(result_dict)
598601

599602
result = {

src/code_indexer/server/mcp/tools.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@
252252
253253
PERFORMANCE NOTE: Searching 5+ repos increases token usage proportionally. Start with limit=3-5 for multi-repo searches.
254254
255+
NOISE FILTERING: Use exclude_path to filter out low-value files:
256+
- exclude_path='**/package-lock.json' (npm lockfiles)
257+
- exclude_path='**/yarn.lock' (yarn lockfiles)
258+
- exclude_path='**/node_modules/**' (dependencies)
259+
- exclude_path='**/test/fixtures/**' (test data)
260+
- exclude_path='**/*.min.js' (minified files)
261+
255262
Use cases:
256263
- Microservices: Search across service repos for shared patterns
257264
- Monorepo + libs: Search main repo with dependency repos together
@@ -335,7 +342,7 @@
335342
},
336343
"exclude_path": {
337344
"type": "string",
338-
"description": "Exclude files matching path pattern. Supports glob patterns (*, **, ?, [seq]). Example: '*/tests/*' to exclude all test files, '*.min.js' to exclude minified JavaScript.",
345+
"description": "Exclude files matching path pattern. Supports glob patterns (*, **, ?, [seq]). COMMON NOISE FILTERS: '**/package-lock.json' (npm), '**/yarn.lock' (yarn), '**/node_modules/**' (deps), '**/test/fixtures/**' (test data), '**/*.min.js' (minified). Can combine with comma: 'pattern1,pattern2' or use multiple calls.",
339346
},
340347
"file_extensions": {
341348
"type": "array",

0 commit comments

Comments
 (0)