@@ -26,6 +26,7 @@ import type { execFileSync } from "child_process";
26
26
import { tryOpenExternalFile } from "../common/vscode/external-files" ;
27
27
import type { VariantAnalysisManager } from "./variant-analysis-manager" ;
28
28
import type { VariantAnalysisResultsManager } from "./variant-analysis-results-manager" ;
29
+ import { getAutofixPath , getAutofixModel } from "../config" ;
29
30
30
31
// Limit to three repos when generating autofixes so not sending
31
32
// too many requests to autofix. Since we only need to validate
@@ -123,7 +124,7 @@ export async function viewAutofixesForVariantAnalysisResults(
123
124
* @throws Error if the AUTOFIX_PATH environment variable is not set or the path does not exist.
124
125
*/
125
126
async function findLocalAutofix ( ) : Promise < string > {
126
- const localAutofixPath = process . env . AUTOFIX_PATH ;
127
+ const localAutofixPath = getAutofixPath ( ) ;
127
128
if ( ! localAutofixPath ) {
128
129
throw new Error (
129
130
"Path to local autofix installation not found. Internal GitHub access required." ,
@@ -635,14 +636,19 @@ async function runAutofixOnResults(
635
636
workDir : string ,
636
637
alertNumber ?: number , // Optional parameter for specific alert
637
638
) : Promise < void > {
639
+ // Get autofix model from user settings.
640
+ const autofixModel = getAutofixModel ( ) ;
641
+ if ( ! autofixModel ) {
642
+ throw new Error ( "Autofix model not found." ) ;
643
+ }
638
644
// Set up args for autofix command.
639
645
const autofixArgs = [
640
646
"--sarif" ,
641
647
sarifFile ,
642
648
"--source-root" ,
643
649
srcRootPath ,
644
650
"--model" ,
645
- "capi-dev-4o" , // may fail with older versions of cocofix
651
+ autofixModel ,
646
652
"--dev" ,
647
653
"--no-cache" ,
648
654
"--format" ,
0 commit comments