Repository navigation
fix(search): name the filter when a filtered codebase_search finds nothing - #210
Merged
giancarloerra merged 1 commit intoOct 23, 2026
Conversation
…thing fileFilter and languageFilter are exact keyword matches, so a directory, glob, bare name of a nested file, or language alias matches nothing. The empty result then told the caller to index an already-indexed project. A filtered search that returns nothing now names the filter and the form it accepts. It keeps the indexing hint when the collection holds no chunks, adds a codebase_status note while indexing is in progress, names both filters together when both are set, and states no cause across linked projects, where a failed collection search is skipped. The minScore and unfiltered replies are unchanged. The fileFilter and languageFilter descriptions and the codebase-exploration skill docs now state the exact-match form. Closes giancarloerra#207 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
CI is approved and all 10 checks passed on |
Owner
|
All 10 CI checks and the substantive CodeRabbit review completed successfully on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #207 as proposed in the issue thread: a filtered
codebase_searchthat finds nothing now says which filter matched nothing and what form it accepts, instead of telling the caller to index an already-indexed project.fileFilterandlanguageFilterremain exact keyword matches; there is no payload change and no reindex.Before, a directory filter returned:
Now:
Changes
src/tools/query-tools.ts: when a filter is set and nothing comes back before theminScorecut,filteredNoResultsLinesbuilds the reply:codebase_statusshows progress;fileFilteris not blamed for a wronglanguageFilter.includeLinked, the reply names the filters but states no cause, becausesearchMultipleCollectionsskips a collection whose query failed, so an empty result does not prove the filter matched nothing.The
minScorereply and the unfiltered reply are unchanged.src/index.ts,skills/codebase-exploration/SKILL.md,skills/codebase-exploration/references/tool-reference.md,DEVELOPER.md: thefileFilterandlanguageFilterdescriptions state the exact-match form, tied to what a result header shows (--- <relativePath> (lines …) [<language>]). The "UsefileFilterwhen you know the area" tip no longer suggests a directory.A filtered search on a project that was never indexed still fails earlier, with Qdrant's
Not Foundfrom the search itself, so it never reaches this branch. I left that out of scope here and can follow up separately if you'd like.Type of change
Testing
npm run test:unit)npm run test:integration)npx tsc --noEmit)Unit tests in
tests/unit/query-tools.test.tscover afileFiltermiss, alanguageFiltermiss, both filters together, a miss while indexing runs, a miss on an empty collection, and a filteredincludeLinkedmiss. A new integration test intests/integration/tools.test.tschecks that an exact relative path returns only that file's chunks; with the QdrantrelativePathfilter deliberately broken it fails. Against a live index,README.mdandpackage.jsonat the project root match by bare name, whileindex.tsforsrc/index.tsdoes not, which is what the new wording says.Checklist
Related issues
Fixes #207
🤖 Generated with Claude Code
Summary by CodeRabbit
Enhancements
Documentation
Tests