diff --git a/packages/amazonq/.changes/next-release/Bug Fix-0c35b577-da17-4132-a0b7-e0d630e73cb9.json b/packages/amazonq/.changes/next-release/Bug Fix-0c35b577-da17-4132-a0b7-e0d630e73cb9.json new file mode 100644 index 00000000000..c7d24855d6b --- /dev/null +++ b/packages/amazonq/.changes/next-release/Bug Fix-0c35b577-da17-4132-a0b7-e0d630e73cb9.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "Improved LLM code review for file review." +} diff --git a/packages/core/src/codewhisperer/util/zipUtil.ts b/packages/core/src/codewhisperer/util/zipUtil.ts index 7678f9dcb12..7e1012b719e 100644 --- a/packages/core/src/codewhisperer/util/zipUtil.ts +++ b/packages/core/src/codewhisperer/util/zipUtil.ts @@ -120,12 +120,8 @@ export class ZipUtil { zip.addFile(zipEntryPath, Buffer.from(content, 'utf-8')) if (scope === CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND) { - await this.processCombinedGitDiff( - zip, - [workspaceFolder.uri.fsPath], - uri.fsPath, - CodeWhispererConstants.CodeAnalysisScope.FILE_ON_DEMAND - ) + const gitDiffContent = `+++ b/${path.normalize(zipEntryPath)}` // Sending file path in payload for LLM code review + zip.addFile(ZipConstants.codeDiffFilePath, Buffer.from(gitDiffContent, 'utf-8')) } } else { zip.addFile(uri.fsPath, Buffer.from(content, 'utf-8'))