@@ -20,6 +20,7 @@ import { codex_agent } from './agents/codex'
2020import { cursor_agent } from './agents/cursor'
2121import { opencode_agent } from './agents/opencode'
2222import { CodingAgent } from './types'
23+ import { format_duration } from './utils'
2324
2425const AGENTS : CodingAgent [ ] = [
2526 antigravity_agent ,
@@ -200,32 +201,39 @@ export const perform_agent_search_mode = async (params: {
200201 . get < string [ ] > ( e . item . configKey , [ ] )
201202 . filter ( ( f ) => f . trim ( ) !== '' )
202203 const deleted_flag = flags [ e . item . flag_index ]
203- const new_flags_array = flags . filter ( ( _ , i ) => i !== e . item . flag_index )
204-
205- config . update (
206- e . item . configKey ,
207- new_flags_array ,
208- vscode . ConfigurationTarget . Global
209- ) . then ( ( ) => {
210- const undo_action = t ( 'common.undo' )
211- vscode . window . showInformationMessage (
212- t ( 'feature.search-files.agent.deleted' as any ) ,
213- undo_action
214- ) . then ( ( choice ) => {
215- if ( choice === undo_action ) {
216- const current_config = vscode . workspace . getConfiguration ( 'codeWebChat' )
217- const current_flags = current_config
218- . get < string [ ] > ( e . item . configKey , [ ] )
219- . filter ( ( f ) => f . trim ( ) !== '' )
220- current_flags . splice ( e . item . flag_index , 0 , deleted_flag )
221- current_config . update (
222- e . item . configKey ,
223- current_flags ,
224- vscode . ConfigurationTarget . Global
204+ const new_flags_array = flags . filter (
205+ ( _ , i ) => i !== e . item . flag_index
206+ )
207+
208+ config
209+ . update (
210+ e . item . configKey ,
211+ new_flags_array ,
212+ vscode . ConfigurationTarget . Global
213+ )
214+ . then ( ( ) => {
215+ const undo_action = t ( 'common.undo' )
216+ vscode . window
217+ . showInformationMessage (
218+ t ( 'feature.search-files.agent.deleted' ) ,
219+ undo_action
225220 )
226- }
221+ . then ( ( choice ) => {
222+ if ( choice === undo_action ) {
223+ const current_config =
224+ vscode . workspace . getConfiguration ( 'codeWebChat' )
225+ const current_flags = current_config
226+ . get < string [ ] > ( e . item . configKey , [ ] )
227+ . filter ( ( f ) => f . trim ( ) !== '' )
228+ current_flags . splice ( e . item . flag_index , 0 , deleted_flag )
229+ current_config . update (
230+ e . item . configKey ,
231+ current_flags ,
232+ vscode . ConfigurationTarget . Global
233+ )
234+ }
235+ } )
227236 } )
228- } )
229237 }
230238 } )
231239
@@ -331,9 +339,10 @@ export const perform_agent_search_mode = async (params: {
331339 root
332340 } ) )
333341
334- const last_selected_root = params . extension_context . workspaceState . get < string > (
335- LAST_SELECTED_WORKSPACE_IN_AGENT_SEARCH_STATE_KEY
336- )
342+ const last_selected_root =
343+ params . extension_context . workspaceState . get < string > (
344+ LAST_SELECTED_WORKSPACE_IN_AGENT_SEARCH_STATE_KEY
345+ )
337346 const active_item =
338347 picks . find ( ( p ) => p . root == last_selected_root ) || picks [ 0 ]
339348
@@ -479,6 +488,7 @@ export const perform_agent_search_mode = async (params: {
479488 let agent_output = ''
480489 let raw_stream_output = ''
481490 let is_cancelled = false
491+ const start_time = Date . now ( )
482492
483493 try {
484494 await vscode . window . withProgress (
@@ -488,7 +498,7 @@ export const perform_agent_search_mode = async (params: {
488498 } ,
489499 async ( progress , token ) => {
490500 progress . report ( {
491- message : t ( 'feature.search-files.progress.searching ' )
501+ message : t ( 'feature.search-files.agent.waiting-for-agent ' )
492502 } )
493503
494504 return new Promise < void > ( ( resolve , reject ) => {
@@ -577,6 +587,11 @@ export const perform_agent_search_mode = async (params: {
577587 continue
578588 }
579589
590+ const duration = format_duration ( Date . now ( ) - start_time )
591+ vscode . window . showInformationMessage (
592+ t ( 'feature.search-files.agent.finished' , { duration } )
593+ )
594+
580595 if ( agent_output . trim ( ) == '' ) {
581596 vscode . window . showInformationMessage (
582597 t ( 'feature.search-files.no-files' )
@@ -592,13 +607,10 @@ export const perform_agent_search_mode = async (params: {
592607 let prefix = ''
593608
594609 if ( roots . length > 1 && selected_root ) {
595- const workspace_name = params . workspace_provider . get_workspace_name (
596- selected_root
597- )
610+ const workspace_name =
611+ params . workspace_provider . get_workspace_name ( selected_root )
598612 prefix = `${ workspace_name } /`
599- const root_files = workspace_files . filter ( ( f ) =>
600- f . startsWith ( prefix )
601- )
613+ const root_files = workspace_files . filter ( ( f ) => f . startsWith ( prefix ) )
602614 const stripped_files = root_files . map ( ( f ) =>
603615 f . substring ( prefix . length )
604616 )
@@ -614,9 +626,7 @@ export const perform_agent_search_mode = async (params: {
614626 new Set (
615627 valid_paths . map ( ( p ) => {
616628 const relative_path =
617- prefix && p . startsWith ( prefix )
618- ? p . substring ( prefix . length )
619- : p
629+ prefix && p . startsWith ( prefix ) ? p . substring ( prefix . length ) : p
620630 return path . join ( selected_root ! , relative_path )
621631 } )
622632 )
@@ -637,7 +647,8 @@ export const perform_agent_search_mode = async (params: {
637647 | undefined
638648
639649 while ( true ) {
640- const currently_checked = params . workspace_provider . get_checked_files ( )
650+ const currently_checked =
651+ params . workspace_provider . get_checked_files ( )
641652 const unmatched_checked_files =
642653 restored_unmatched_paths ??
643654 ( params . is_search_in_selected
0 commit comments