@@ -12,6 +12,7 @@ import {
1212 edit_provider_for_config ,
1313 edit_reasoning_effort_for_config ,
1414 edit_temperature_for_config ,
15+ edit_system_instructions_override_for_config ,
1516 initial_select_model ,
1617 initial_select_provider
1718} from './config-editing'
@@ -392,6 +393,21 @@ export const upsert_configuration = async (params: {
392393
393394 const advanced_items : vscode . QuickPickItem [ ] = [ temperature_item ]
394395
396+ if ( params . tool_type == 'edit-context' ) {
397+ const system_instr_item : vscode . QuickPickItem = {
398+ label : 'System Instructions' ,
399+ description : 'Overrides global system instructions' ,
400+ detail : updated_config . system_instructions_override
401+ }
402+ if ( updated_config . system_instructions_override ) {
403+ system_instr_item . buttons = [
404+ { iconPath : new vscode . ThemeIcon ( 'eraser' ) , tooltip : 'Unset' }
405+ ]
406+ }
407+
408+ advanced_items . push ( system_instr_item )
409+ }
410+
395411 const selected_advanced = await new Promise <
396412 vscode . QuickPickItem | undefined
397413 > ( ( resolve ) => {
@@ -402,7 +418,7 @@ export const upsert_configuration = async (params: {
402418 quick_pick . buttons = [ vscode . QuickInputButtons . Back ]
403419 if ( last_advanced_label ) {
404420 const active = advanced_items . find (
405- ( i ) => i . label === last_advanced_label
421+ ( i ) => i . label == last_advanced_label
406422 )
407423 if ( active ) quick_pick . activeItems = [ active ]
408424 }
@@ -411,11 +427,16 @@ export const upsert_configuration = async (params: {
411427
412428 disposables . push (
413429 quick_pick . onDidTriggerItemButton ( ( e ) => {
414- if ( e . item . label === 'Temperature' ) {
430+ if ( e . item . label == 'Temperature' ) {
415431 delete updated_config . temperature
416432 accepted = true
417433 resolve ( { label : 'REFRESH' } )
418434 quick_pick . hide ( )
435+ } else if ( e . item . label === 'System Instructions' ) {
436+ delete updated_config . system_instructions_override
437+ accepted = true
438+ resolve ( { label : 'REFRESH' } )
439+ quick_pick . hide ( )
419440 }
420441 } ) ,
421442 quick_pick . onDidAccept ( ( ) => {
@@ -438,7 +459,7 @@ export const upsert_configuration = async (params: {
438459 } )
439460
440461 if ( ! selected_advanced ) break
441- if ( selected_advanced . label === 'REFRESH' ) continue
462+ if ( selected_advanced . label == 'REFRESH' ) continue
442463
443464 last_advanced_label = selected_advanced . label
444465
@@ -448,6 +469,13 @@ export const upsert_configuration = async (params: {
448469 updated_config . temperature =
449470 new_temp === null ? undefined : new_temp
450471 }
472+ } else if ( selected_advanced . label == 'System Instructions' ) {
473+ const new_instr =
474+ await edit_system_instructions_override_for_config ( updated_config )
475+ if ( new_instr !== undefined ) {
476+ updated_config . system_instructions_override =
477+ new_instr === null ? undefined : new_instr
478+ }
451479 }
452480 }
453481 }
0 commit comments