@krotovm/gitlab-ai-review 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/ci-review.js +11 -2
- package/dist/prompt/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/ci-review.js
CHANGED
|
@@ -598,6 +598,7 @@ export async function reviewMergeRequestMultiPass(params) {
|
|
|
598
598
|
}));
|
|
599
599
|
const triageMessages = buildTriagePrompt(triageInputs);
|
|
600
600
|
let triageResult = null;
|
|
601
|
+
let triageText = null;
|
|
601
602
|
try {
|
|
602
603
|
const triageCompletion = await createCompletionWithDebug({
|
|
603
604
|
openaiInstance,
|
|
@@ -612,7 +613,7 @@ export async function reviewMergeRequestMultiPass(params) {
|
|
|
612
613
|
response_format: { type: "json_object" },
|
|
613
614
|
},
|
|
614
615
|
});
|
|
615
|
-
|
|
616
|
+
triageText = extractCompletionText(triageCompletion);
|
|
616
617
|
if (triageText != null)
|
|
617
618
|
triageResult = parseTriageResponse(triageText);
|
|
618
619
|
}
|
|
@@ -620,7 +621,15 @@ export async function reviewMergeRequestMultiPass(params) {
|
|
|
620
621
|
logStep(`Triage pass failed: ${error?.message ?? error}. Falling back to single-pass.`);
|
|
621
622
|
}
|
|
622
623
|
if (triageResult == null) {
|
|
623
|
-
|
|
624
|
+
if (triageText != null) {
|
|
625
|
+
const triagePreview = triageText.replace(/\s+/g, " ").trim().slice(0, 200);
|
|
626
|
+
const looksLikeHtml = /<html|<!doctype html/i.test(triageText);
|
|
627
|
+
logStep(`Triage parse failed: expected JSON but got ${looksLikeHtml ? "HTML/non-JSON" : "non-JSON"} response. Preview: ${triagePreview || "<empty>"}`);
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
logStep("Triage parse failed: model returned empty response body.");
|
|
631
|
+
}
|
|
632
|
+
logStep("Falling back to single-pass pipeline.");
|
|
624
633
|
return await reviewMergeRequestWithTools({
|
|
625
634
|
openaiInstance,
|
|
626
635
|
aiModel,
|
package/dist/prompt/index.js
CHANGED
|
@@ -126,7 +126,7 @@ export function buildConsolidatePrompt(params) {
|
|
|
126
126
|
];
|
|
127
127
|
}
|
|
128
128
|
export function buildVerificationPrompt(params) {
|
|
129
|
-
const { perFileFindings, summary, consolidatedFindings, maxFindings, refs
|
|
129
|
+
const { perFileFindings, summary, consolidatedFindings, maxFindings, refs } = params;
|
|
130
130
|
const findingsText = perFileFindings
|
|
131
131
|
.map((f) => `### ${f.path}\n${f.findings}`)
|
|
132
132
|
.join("\n\n");
|