Skip to content

Commit 9f5bfe4

Browse files
authored
fix(amazonq): Improved LLM code review for file review #6162
## Problem - Code diff for file review format has changed in payload to improve LLM based code review accuracy and is dependent on git. ## Solution - We are currently send entire file in diff format and run git commands to extract it. This change will remove git dependency for LLM based code review issues.
1 parent e0c153f commit 9f5bfe4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Improved LLM code review for file review."
4+
}

packages/core/src/codewhisperer/util/zipUtil.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,8 @@ export class ZipUtil {
122122
zip.addFile(zipEntryPath, Buffer.from(content, 'utf-8'))
123123

124124
if (scope === CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND) {
125-
await this.processCombinedGitDiff(
126-
zip,
127-
[workspaceFolder.uri.fsPath],
128-
uri.fsPath,
129-
CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND
130-
)
125+
const gitDiffContent = `+++ b/${path.normalize(zipEntryPath)}` // Sending file path in payload for LLM code review
126+
zip.addFile(ZipConstants.codeDiffFilePath, Buffer.from(gitDiffContent, 'utf-8'))
131127
}
132128
} else {
133129
zip.addFile(uri.fsPath, Buffer.from(content, 'utf-8'))

0 commit comments

Comments
 (0)