You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 05de6ee
Browse filesBrowse the repository at this point in the historyBrowse files
constchunkPrompt=`You are a helpful and expert AI code reviewer. Analyze the following Git diff chunk. Your response must be highly structured and strictly focused on identifying issues and providing solutions.
170
+
171
+
constchunkPrompt=`You are a helpful and expert AI code reviewer. Analyze the following Git diff chunk. Your response must be highly structured and strictly focused on identifying issues and providing solutions.
172
172
173
173
For each issue found, format your finding with a clear bullet point and, if the fix is simple, provide the recommended code change directly beneath it in a code block.
console.error(`Fatal error encountered during review chunk processing. Aborting review.`);
198
-
198
+
199
199
// Post a single error message and return immediately
200
200
consterrorMessage=`❌ **AI Review Failed** ❌\n\nA critical error occurred during the review process (likely due to an incorrect model configuration, service key issue, or a malformed request). The first error encountered was:\n\n\`\`\`\n${error.message}\n\`\`\`\n\n**Action Required:** Please check the model configuration, service key, and retry the review.`;
conststatus=similar.state==="closed" ? "closed" : "in progress";
374
374
constresolution=extractResolution(similar.body);
375
-
376
-
constduplicateComment=`### 🔁 Potential Duplicate Detected (Semantic Match)\nBased on **issue context and body**, a related issue appears to already exist: **#${similar.number} - ${similar.title}** (${status}).\n\n**Link:** ${similar.html_url}\n\n**Summary (Truncated):**\n${truncate(similar.body||'(no body)',800)}\n\n${resolution ? `**Extracted Resolution / Status Notes:**\n${resolution}\n\n` : ''}If this is a duplicate, please consolidate discussion there and consider closing this one. If not, comment with \`not a duplicate\` and I will proceed with fresh root-cause analysis.`;awaitoctokit.rest.issues.createComment({ owner, repo,issue_number: issueNumber,body: duplicateComment});
375
+
376
+
constduplicateComment=`### 🔁 Potential Duplicate Detected (Semantic Match)\nBased on **issue context and body**, a related issue appears to already exist: **#${similar.number} - ${similar.title}** (${status}).\n\n**Link:** ${similar.html_url}\n\n**Summary (Truncated):**\n${truncate(similar.body||'(no body)',800)}\n\n${resolution ? `**Extracted Resolution / Status Notes:**\n${resolution}\n\n` : ''}If this is a duplicate, please consolidate discussion there and consider closing this one. If not, comment with \`not a duplicate\` and I will proceed with fresh root-cause analysis.`;awaitoctokit.rest.issues.createComment({ owner, repo,issue_number: issueNumber,body: duplicateComment});
constrecPrompt=`You are an expert senior engineer. A new issue was filed. Use the code contexts to hypothesize root causes and generate a detailed, prioritized remediation checklist. Your output must strictly follow the required markdown structure below.
386
386
387
387
Crucially, for the most likely and actionable remediation steps, you **must include the exact code snippet** showing the required change in a markdown code block. Do not just describe the fix—show the code.
@@ -421,7 +421,7 @@ async function handleNewIssue(octokit, owner, repo, issueNumber, issueTitle, iss
421
421
Relevant Code Contexts (truncated):
422
422
${truncate(joinedContexts,12000)}
423
423
`;
424
-
424
+
425
425
letrecommendations="Failed to generate recommendations.";
@@ -433,7 +433,7 @@ async function handleNewIssue(octokit, owner, repo, issueNumber, issueTitle, iss
433
433
// Post a single error message for the issue handler
434
434
recommendations=`❌ **AI Analysis Failed** ❌\n\nA critical error occurred while generating the initial analysis (likely due to an incorrect model configuration, service key issue, or a malformed request). The error was:\n\n\`\`\`\n${error.message}\n\`\`\`\n\n**Action Required:** Please check the model configuration and service key.`;
435
435
}
436
-
436
+
437
437
awaitensureLabel(octokit,owner,repo,"awaiting-confirmation",{description: "Pending maintainer confirmation for remediation",color: "5319e7"});
constconfirmComment=`${recommendations}\n\n**Next Step:** Reply with \`confirm remediation\` to approve moving forward (e.g., drafting a PR or creating task list). Reply with \`refine analysis\` for a deeper pass, or \`discard recommendations\` to remove them.`;
awaitoctokit.rest.issues.createComment({ owner, repo,issue_number: number,body: '🗑️ Recommendations discarded. Provide new details or ask for re-analysis if needed.'});
0 commit comments