@@ -34,7 +34,7 @@ export const invoke_agentic_cli = async (params: {
3434 copy_selected_files ?: boolean
3535 run_in_terminal ?: boolean
3636 generate_diff_for_temp_dir ?: boolean
37- agent_args_type ?: 'isolated-dir ' | 'integrated -terminal'
37+ execution_mode ?: 'headless ' | 'interactive -terminal'
3838 cli_configuration_name ?: string
3939 use_quick_pick ?: boolean
4040} ) : Promise <
@@ -308,9 +308,14 @@ export const invoke_agentic_cli = async (params: {
308308 > ( )
309309
310310 if ( params . isolate_in_temp_dir ) {
311- temp_dir_path = await fs . promises . mkdtemp (
312- path . join ( os . tmpdir ( ) , 'cwc-cli-' )
313- )
311+ if ( params . copy_selected_files ) {
312+ temp_dir_path = await fs . promises . mkdtemp (
313+ path . join ( os . tmpdir ( ) , 'cwc-cli-' )
314+ )
315+ } else {
316+ temp_dir_path = path . join ( os . tmpdir ( ) , 'cwc-cli' )
317+ await fs . promises . mkdir ( temp_dir_path , { recursive : true } )
318+ }
314319
315320 if ( params . copy_selected_files ) {
316321 const selected_files = params . workspace_provider . get_selected_files ( )
@@ -476,7 +481,7 @@ export const invoke_agentic_cli = async (params: {
476481
477482 if ( params . run_in_terminal ) {
478483 const base_args =
479- params . agent_args_type === 'integrated -terminal'
484+ params . execution_mode === 'interactive -terminal'
480485 ? agent_info . get_integrated_terminal_args
481486 ? agent_info . get_integrated_terminal_args ( { cwd : selected_root } )
482487 : [ ]
@@ -514,7 +519,7 @@ export const invoke_agentic_cli = async (params: {
514519 terminal . sendText ( command )
515520
516521 if (
517- params . agent_args_type === 'integrated -terminal' &&
522+ params . execution_mode === 'interactive -terminal' &&
518523 agent_info . get_post_integrated_terminal_args
519524 ) {
520525 const post_args = agent_info . get_post_integrated_terminal_args ( )
@@ -553,7 +558,7 @@ export const invoke_agentic_cli = async (params: {
553558 }
554559
555560 const base_args =
556- params . agent_args_type === 'integrated -terminal'
561+ params . execution_mode === 'interactive -terminal'
557562 ? agent_info . get_integrated_terminal_args
558563 ? agent_info . get_integrated_terminal_args ( {
559564 cwd : selected_root
0 commit comments