11import { PanelProvider } from '@/views/panel/backend/panel-provider'
22import * as vscode from 'vscode'
33import { FilesCollector } from '@/utils/files-collector'
4- import { apply_preset_affixes_to_instruction } from '@/utils/apply-preset-affixes'
54import {
65 code_at_cursor_instructions_for_panel ,
76 find_relevant_files_instructions ,
@@ -159,15 +158,10 @@ export const handle_send_to_browser = async (params: {
159158
160159 const prepared_chats = await Promise . all (
161160 resolved_preset_names . map ( async ( preset_name ) => {
162- const instructions = apply_preset_affixes_to_instruction ( {
163- instruction : current_instructions ,
164- preset_name : preset_name ,
165- presets_config_key : params . panel_provider . get_presets_config_key ( )
166- } )
167161
168162 const { instruction : processed_instructions , skill_definitions } =
169163 await replace_symbols ( {
170- instruction : instructions ,
164+ instruction : current_instructions ,
171165 context : params . panel_provider . context ,
172166 workspace_provider : params . panel_provider . workspace_provider ,
173167 remove_images : true
@@ -367,9 +361,7 @@ const show_preset_quick_pick = async (params: {
367361 if ( params . get_is_preset_disabled ( preset ) ) {
368362 if (
369363 ! params . is_in_code_completions_mode &&
370- ! params . current_instructions &&
371- ! preset . promptPrefix &&
372- ! preset . promptSuffix
364+ ! params . current_instructions
373365 ) {
374366 params . panel_provider . send_message ( {
375367 command : 'SHOW_AUTO_CLOSING_MODAL' ,
@@ -496,12 +488,7 @@ const resolve_presets = async (params: {
496488 ( is_in_code_completions_mode &&
497489 ( ! params . panel_provider . currently_open_file_path ||
498490 ! ! params . panel_provider . current_selection ) ) ||
499- ( ! is_in_code_completions_mode &&
500- ! (
501- current_instructions ||
502- preset . promptPrefix ||
503- preset . promptSuffix
504- ) ) ) ) ||
491+ ( ! is_in_code_completions_mode && ! current_instructions ) ) ) ||
505492 false
506493
507494 if ( params . preset_name !== undefined ) {
@@ -510,9 +497,7 @@ const resolve_presets = async (params: {
510497 if ( get_is_preset_disabled ( preset ) ) {
511498 if (
512499 ! is_in_code_completions_mode &&
513- ! current_instructions &&
514- ! preset . promptPrefix &&
515- ! preset . promptSuffix
500+ ! current_instructions
516501 ) {
517502 params . panel_provider . send_message ( {
518503 command : 'SHOW_AUTO_CLOSING_MODAL' ,
@@ -554,11 +539,9 @@ const resolve_presets = async (params: {
554539 ( p ) => p . name && ! preset_names . includes ( p . name )
555540 )
556541 const any_disabled_due_to_instructions = disabled_presets . some (
557- ( p ) =>
542+ ( ) =>
558543 ! is_in_code_completions_mode &&
559- ! current_instructions &&
560- ! p . promptPrefix &&
561- ! p . promptSuffix
544+ ! current_instructions
562545 )
563546 if ( any_disabled_due_to_instructions ) {
564547 vscode . window . showWarningMessage (
@@ -572,11 +555,9 @@ const resolve_presets = async (params: {
572555
573556 if ( default_presets_in_group . length > 0 ) {
574557 const any_disabled_due_to_instructions = default_presets_in_group . some (
575- ( p ) =>
558+ ( ) =>
576559 ! is_in_code_completions_mode &&
577- ! current_instructions &&
578- ! p . promptPrefix &&
579- ! p . promptSuffix
560+ ! current_instructions
580561 )
581562 if ( any_disabled_due_to_instructions ) {
582563 params . panel_provider . send_message ( {
@@ -617,9 +598,7 @@ const resolve_presets = async (params: {
617598 if ( get_is_preset_disabled ( item ) ) {
618599 if (
619600 ! is_in_code_completions_mode &&
620- ! current_instructions &&
621- ! item . promptPrefix &&
622- ! item . promptSuffix
601+ ! current_instructions
623602 ) {
624603 params . panel_provider . send_message ( {
625604 command : 'SHOW_AUTO_CLOSING_MODAL' ,
0 commit comments