From c955b880bc9fea53c2d13dad118356891fe6bda1 Mon Sep 17 00:00:00 2001 From: Daniel Campagnoli Date: Thu, 19 Sep 2024 11:28:35 +0800 Subject: [PATCH] Update analyzeCompileError to better include files with compile errors --- src/swe/analyzeCompileErrors.ts | 8 +++++--- src/swe/documentationBuilder.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/swe/analyzeCompileErrors.ts b/src/swe/analyzeCompileErrors.ts index 62e9c804..ed210786 100644 --- a/src/swe/analyzeCompileErrors.ts +++ b/src/swe/analyzeCompileErrors.ts @@ -37,17 +37,19 @@ export async function analyzeCompileErrors( } const compileOutputXml = `\n${compilerOutput}\n`; + const currentFileList = `\n${initialFileSelection.join('\n')}\n`; + const instructions = 'The compile errors above need to be analyzed to determine next steps fixing them. You will respond with a JSON object in the format of the example.\n' + '- Include a brief summary of the compile issues in the "compileIssuesSummary" property.\n' + - '- If addtional files are required to be added to the context to help fix the issues (for implementation details, interfaces, typings etc. or with compile errors to fix) then set an array of the filenames on the "additionalFiles" property.\n' + + '- If addtional files not in the tag are required to be added to the context to help fix the issues (ie. have compile errors to fix in that file, or needed for implementation details, interfaces, typings etc) then set an array of the filenames on the "additionalFiles" property.\n' + '- If you need to perform research to fix a compile issue (e.g. how to use a library/API, or fix an obscure compiler error) then set a natural language query to search on the "researchQuery" property.\n' + '- If the compile errors indicate one or more missing packages/modules, then set an array with the missing packages, e.g. ["package1", "package2"], on the "installPackages" property.\n' + '- If there appears to be an fatal error which can\'t be fixed (e.g. configuration issue, or stuck on the same error multiple times, or a dependant project needs to be updated) that requires human intervention, then set a message describing the problem in the "fatalError" property.\n' + `Respond with your resoning following by the JSON object that MUST be in the format of this example: - Analysis of the compile issues -- Reasoning if any additional files need to be added to the context +- Reasoning if any additional files need to be added to the available list which have compile errors or required implementation details - Reasoning if any web research is required to fix issues - Reasoning if there is a fatal error @@ -62,7 +64,7 @@ export async function analyzeCompileErrors( `; // ${fileList}\n - const prompt = `${fileContents}\n${compileErrorHistory}\n${compileOutputXml}\n${instructions}`; + const prompt = `${fileContents}\n${compileErrorHistory}\n${compileOutputXml}\n${currentFileList}\n${instructions}`; const analysis: CompileErrorAnalysis = await llms().hard.generateJson(prompt, null, { id: 'analyzeCompileErrors', }); diff --git a/src/swe/documentationBuilder.ts b/src/swe/documentationBuilder.ts index 2f30b37f..6a669a9e 100644 --- a/src/swe/documentationBuilder.ts +++ b/src/swe/documentationBuilder.ts @@ -372,7 +372,7 @@ export async function getTopLevelSummary(): Promise { export async function getRepositoryOverview(): Promise { const repositoryOverview: string = await getTopLevelSummary(); - return repositoryOverview ? '\n${topLevelSummary}\n\n' : ''; + return repositoryOverview ? `\n${repositoryOverview}\n\n` : ''; } async function getParentSummaries(folderPath: string): Promise {