Skip to content

Commit a26a5b4

Browse files
committed
fix: normalize paths starting with './' and fix OS-dependency issue
- Use forward slash for splitting after toPosix() conversion - Remove leading './' from paths like './src' to normalize them to 'src' - Update test expectations to match correct behavior
1 parent 11413fb commit a26a5b4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,14 +1679,10 @@ describe("QdrantVectorStore", () => {
16791679
must: [
16801680
{
16811681
key: "pathSegments.0",
1682-
match: { value: "." },
1683-
},
1684-
{
1685-
key: "pathSegments.1",
16861682
match: { value: "src" },
16871683
},
16881684
],
1689-
}, // Should still create filter for actual relative paths
1685+
}, // Should normalize "./src" to "src"
16901686
score_threshold: DEFAULT_SEARCH_MIN_SCORE,
16911687
limit: DEFAULT_MAX_SEARCH_RESULTS,
16921688
params: {

src/services/code-index/vector-store/qdrant-client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ export class QdrantVectorStore implements IVectorStore {
381381
// Don't create a filter - search entire workspace
382382
filter = undefined
383383
} else {
384-
const segments = normalizedPrefix.split("/").filter(Boolean)
384+
// Remove leading "./" from paths like "./src" to normalize them
385+
const cleanedPrefix = normalizedPrefix.startsWith("./")
386+
? normalizedPrefix.slice(2)
387+
: normalizedPrefix
388+
const segments = cleanedPrefix.split("/").filter(Boolean)
385389
if (segments.length > 0) {
386390
filter = {
387391
must: segments.map((segment, index) => ({

0 commit comments

Comments
 (0)