Skip to content

Commit 36e6f98

Browse files
committed
fix: revert unintended changes to file-watcher and scanner
- Reverted point ID generation back to using line numbers instead of segmentHash - Restored { cause: deleteError } parameter in scanner error handling - These changes were unrelated to the embedder validation feature
1 parent 9c0a7ba commit 36e6f98

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/code-index/processors/file-watcher.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ export class FileWatcher implements IFileWatcher {
513513

514514
pointsToUpsert = blocks.map((block, index) => {
515515
const normalizedAbsolutePath = generateNormalizedAbsolutePath(block.file_path, this.workspacePath)
516-
// Use segmentHash for unique ID generation to handle multiple segments from same line
517-
const pointId = uuidv5(block.segmentHash, QDRANT_CODE_BLOCK_NAMESPACE)
516+
const stableName = `${normalizedAbsolutePath}:${block.start_line}`
517+
const pointId = uuidv5(stableName, QDRANT_CODE_BLOCK_NAMESPACE)
518518

519519
return {
520520
id: pointId,
@@ -524,7 +524,6 @@ export class FileWatcher implements IFileWatcher {
524524
codeChunk: block.content,
525525
startLine: block.start_line,
526526
endLine: block.end_line,
527-
segmentHash: block.segmentHash,
528527
},
529528
}
530529
})

src/services/code-index/processors/scanner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ export class DirectoryScanner implements IDirectoryScanner {
312312
// Re-throw the error with workspace context
313313
throw new Error(
314314
`Failed to delete points for ${uniqueFilePaths.length} files. Workspace: ${scanWorkspace}. ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`,
315+
{ cause: deleteError },
315316
)
316317
}
317318
}

0 commit comments

Comments
 (0)