Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ describe("QdrantVectorStore", () => {
vectors: {
size: mockVectorSize,
distance: "Cosine", // Assuming 'Cosine' is the DISTANCE_METRIC
on_disk: true,
},
hnsw_config: {
m: 64,
ef_construct: 512,
on_disk: true,
},
})
expect(mockQdrantClientInstance.deleteCollection).not.toHaveBeenCalled()
Expand Down Expand Up @@ -610,6 +616,12 @@ describe("QdrantVectorStore", () => {
vectors: {
size: mockVectorSize, // Should use the new, correct vector size
distance: "Cosine",
on_disk: true,
},
hnsw_config: {
m: 64,
ef_construct: 512,
on_disk: true,
},
})

Expand Down Expand Up @@ -903,6 +915,12 @@ describe("QdrantVectorStore", () => {
vectors: {
size: newVectorSize, // Should create with new 768 dimensions
distance: "Cosine",
on_disk: true,
},
hnsw_config: {
m: 64,
ef_construct: 512,
on_disk: true,
},
})
expect(mockQdrantClientInstance.createPayloadIndex).toHaveBeenCalledTimes(5)
Expand Down
14 changes: 12 additions & 2 deletions src/services/code-index/vector-store/qdrant-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ export class QdrantVectorStore implements IVectorStore {
vectors: {
size: this.vectorSize,
distance: this.DISTANCE_METRIC,
on_disk: true,
},
hnsw_config: {
m: 64,
ef_construct: 512,
on_disk: true,
},
})
created = true
Expand Down Expand Up @@ -244,6 +250,12 @@ export class QdrantVectorStore implements IVectorStore {
vectors: {
size: this.vectorSize,
distance: this.DISTANCE_METRIC,
on_disk: true,
},
hnsw_config: {
m: 64,
ef_construct: 512,
on_disk: true,
},
})
console.log(`[QdrantVectorStore] Successfully created new collection ${this.collectionName}`)
Expand Down Expand Up @@ -491,8 +503,6 @@ export class QdrantVectorStore implements IVectorStore {
// Include first few file paths for debugging (avoid logging too many)
samplePaths: filePaths.slice(0, 3),
})

throw error
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the here silently swallows errors, which might hide important issues. While preventing disruption is good, consider:

  1. Logging at a higher severity level (console.error is already there, which is good)
  2. Implementing a retry mechanism for transient failures
  3. Only catching specific non-critical errors and re-throwing critical ones

For example:

}

Expand Down
Loading