@eldrforge/kodrdriv 1.2.124 → 1.2.126

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.
@@ -16,6 +16,7 @@ import path__default from 'path';
16
16
  import os__default from 'os';
17
17
  import { spawn } from 'child_process';
18
18
  import fs from 'fs/promises';
19
+ import { filterContent } from '../util/stopContext.js';
19
20
 
20
21
  // Utility function to read a review note from a file
21
22
  const readReviewNoteFromFile = async (filePath)=>{
@@ -418,7 +419,7 @@ const processSingleReview = async (reviewNote, runConfig, outputDirectory)=>{
418
419
  }).formatPrompt(modelToUse, prompt);
419
420
  let analysisResult;
420
421
  try {
421
- var _aiConfig_commands_review1, _aiConfig_commands1;
422
+ var _aiConfig_commands_review1, _aiConfig_commands1, _rawAnalysisResult_issues;
422
423
  const rawResult = await createCompletion(request.messages, {
423
424
  model: modelToUse,
424
425
  openaiReasoning: ((_aiConfig_commands1 = aiConfig.commands) === null || _aiConfig_commands1 === void 0 ? void 0 : (_aiConfig_commands_review1 = _aiConfig_commands1.review) === null || _aiConfig_commands_review1 === void 0 ? void 0 : _aiConfig_commands_review1.reasoning) || aiConfig.reasoning,
@@ -432,7 +433,17 @@ const processSingleReview = async (reviewNote, runConfig, outputDirectory)=>{
432
433
  logger: aiLogger
433
434
  });
434
435
  // Validate the API response before using it
435
- analysisResult = validateReviewResult(rawResult);
436
+ const rawAnalysisResult = validateReviewResult(rawResult);
437
+ // Apply stop-context filtering to issues
438
+ analysisResult = {
439
+ ...rawAnalysisResult,
440
+ summary: filterContent(rawAnalysisResult.summary, runConfig.stopContext).filtered,
441
+ issues: (_rawAnalysisResult_issues = rawAnalysisResult.issues) === null || _rawAnalysisResult_issues === void 0 ? void 0 : _rawAnalysisResult_issues.map((issue)=>({
442
+ ...issue,
443
+ title: filterContent(issue.title, runConfig.stopContext).filtered,
444
+ description: filterContent(issue.description || '', runConfig.stopContext).filtered
445
+ }))
446
+ };
436
447
  } catch (error) {
437
448
  logger.error(`REVIEW_ANALYSIS_FAILED: Unable to analyze review note | Error: ${error.message} | Impact: Cannot identify issues`);
438
449
  throw new Error(`Review analysis failed: ${error.message}`);