@@ -26,6 +26,7 @@ import type { execFileSync } from "child_process";
2626import { tryOpenExternalFile } from "../common/vscode/external-files" ;
2727import type { VariantAnalysisManager } from "./variant-analysis-manager" ;
2828import type { VariantAnalysisResultsManager } from "./variant-analysis-results-manager" ;
29+ import { getAutofixPath , getAutofixModel } from "../config" ;
2930
3031// Limit to three repos when generating autofixes so not sending
3132// too many requests to autofix. Since we only need to validate
@@ -123,7 +124,7 @@ export async function viewAutofixesForVariantAnalysisResults(
123124 * @throws Error if the AUTOFIX_PATH environment variable is not set or the path does not exist.
124125 */
125126async function findLocalAutofix ( ) : Promise < string > {
126- const localAutofixPath = process . env . AUTOFIX_PATH ;
127+ const localAutofixPath = getAutofixPath ( ) ;
127128 if ( ! localAutofixPath ) {
128129 throw new Error (
129130 "Path to local autofix installation not found. Internal GitHub access required." ,
@@ -635,14 +636,19 @@ async function runAutofixOnResults(
635636 workDir : string ,
636637 alertNumber ?: number , // Optional parameter for specific alert
637638) : 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+ }
638644 // Set up args for autofix command.
639645 const autofixArgs = [
640646 "--sarif" ,
641647 sarifFile ,
642648 "--source-root" ,
643649 srcRootPath ,
644650 "--model" ,
645- "capi-dev-4o" , // may fail with older versions of cocofix
651+ autofixModel ,
646652 "--dev" ,
647653 "--no-cache" ,
648654 "--format" ,
0 commit comments