@@ -30,6 +30,7 @@ export interface ExtensionHostOptions {
3030 apiKey ?: string
3131 apiProvider ?: string
3232 model ?: string
33+ mode ?: string
3334}
3435
3536interface ExtensionModule {
@@ -493,38 +494,48 @@ export class ExtensionHost extends EventEmitter {
493494 // In interactive mode (default), we'll prompt the user for each action
494495 if ( this . options . nonInteractive ) {
495496 this . log ( "Non-interactive mode: enabling auto-approval settings..." )
497+ const settings : Record < string , unknown > = {
498+ autoApprovalEnabled : true ,
499+ alwaysAllowReadOnly : true ,
500+ alwaysAllowReadOnlyOutsideWorkspace : true ,
501+ alwaysAllowWrite : true ,
502+ alwaysAllowWriteOutsideWorkspace : true ,
503+ alwaysAllowWriteProtected : false , // Keep protected files safe.
504+ alwaysAllowBrowser : true ,
505+ alwaysAllowMcp : true ,
506+ alwaysAllowModeSwitch : true ,
507+ alwaysAllowSubtasks : true ,
508+ alwaysAllowExecute : true ,
509+ alwaysAllowFollowupQuestions : true ,
510+ // Enable reasoning/thinking tokens for models that support it.
511+ enableReasoningEffort : true ,
512+ reasoningEffort : "medium" ,
513+ // Allow all commands with wildcard (required for command auto-approval).
514+ allowedCommands : [ "*" ] ,
515+ }
516+ // Include mode if specified
517+ if ( this . options . mode ) {
518+ settings . mode = this . options . mode
519+ }
496520 this . sendToExtension ( {
497521 type : "updateSettings" ,
498- updatedSettings : {
499- autoApprovalEnabled : true ,
500- alwaysAllowReadOnly : true ,
501- alwaysAllowReadOnlyOutsideWorkspace : true ,
502- alwaysAllowWrite : true ,
503- alwaysAllowWriteOutsideWorkspace : true ,
504- alwaysAllowWriteProtected : false , // Keep protected files safe.
505- alwaysAllowBrowser : true ,
506- alwaysAllowMcp : true ,
507- alwaysAllowModeSwitch : true ,
508- alwaysAllowSubtasks : true ,
509- alwaysAllowExecute : true ,
510- alwaysAllowFollowupQuestions : true ,
511- // Enable reasoning/thinking tokens for models that support it.
512- enableReasoningEffort : true ,
513- reasoningEffort : "medium" ,
514- // Allow all commands with wildcard (required for command auto-approval).
515- allowedCommands : [ "*" ] ,
516- } ,
522+ updatedSettings : settings ,
517523 } )
518524 } else {
519525 this . log ( "Interactive mode: user will be prompted for approvals..." )
526+ const settings : Record < string , unknown > = {
527+ autoApprovalEnabled : false ,
528+ // Enable reasoning/thinking tokens for models that support it
529+ enableReasoningEffort : true ,
530+ reasoningEffort : "medium" ,
531+ }
532+ // Include mode if specified
533+ if ( this . options . mode ) {
534+ settings . mode = this . options . mode
535+ }
520536 this . sendToExtension ( {
521537 type : "updateSettings" ,
522- updatedSettings : {
523- autoApprovalEnabled : false ,
524- // Enable reasoning/thinking tokens for models that support it
525- enableReasoningEffort : true ,
526- reasoningEffort : "medium" ,
527- } ,
538+ updatedSettings : settings ,
528539 } )
529540 }
530541
0 commit comments