File tree Expand file tree Collapse file tree
apps/editor/src/features/search-files/search-modes/perform-agent-search-mode Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { CodingAgent } from '../types'
2- import { build_agent_prompt , check_command_exists } from '../utils'
2+ import { build_agent_prompt , check_command_exists , get_progress_dots } from '../utils'
33
44let last_action_name = ''
55let action_count = 0
@@ -21,12 +21,10 @@ export const antigravity_agent: CodingAgent = {
2121 if ( parsed . event == 'step_update' && parsed . step_update ) {
2222 const step = parsed . step_update
2323 let action_name = ''
24- let has_dots = false
2524
2625 if ( step . step_type == 'tool' ) {
2726 if ( step . tool_name ) {
2827 action_name = step . tool_name . replace ( / _ / g, ' ' )
29- has_dots = true
3028 }
3129 } else if ( step . subagent_info ?. subagents ?. length > 0 ) {
3230 const subagent = step . subagent_info . subagents [ 0 ]
@@ -40,11 +38,7 @@ export const antigravity_agent: CodingAgent = {
4038 last_action_name = action_name
4139 action_count = 1
4240 }
43- const extra_dots =
44- action_count > 1
45- ? ( has_dots ? ' ' : '' ) + '.' . repeat ( action_count - 1 )
46- : ''
47- report_progress ( `${ action_name } ${ has_dots ? '...' : '' } ${ extra_dots } ` )
41+ report_progress ( `${ action_name } ${ get_progress_dots ( action_count ) } ` )
4842 }
4943 } else if ( parsed . event == 'result' && parsed . result ) {
5044 last_action_name = ''
Original file line number Diff line number Diff line change 11import { CodingAgent } from '../types'
2- import { build_agent_prompt , check_command_exists } from '../utils'
2+ import { build_agent_prompt , check_command_exists , get_progress_dots } from '../utils'
33
44let last_action_name = ''
55let action_count = 0
@@ -50,9 +50,7 @@ export const codex_agent: CodingAgent = {
5050 last_action_name = action_name
5151 action_count = 1
5252 }
53- const extra_dots =
54- action_count > 1 ? ' ' + '.' . repeat ( action_count - 1 ) : ''
55- report_progress ( `${ action_name } ...${ extra_dots } ` )
53+ report_progress ( `${ action_name } ${ get_progress_dots ( action_count ) } ` )
5654 }
5755 } else if ( parsed . type == 'item.completed' && parsed . item ) {
5856 if ( parsed . item . type == 'agent_message' && parsed . item . text ) {
Original file line number Diff line number Diff line change 11import { CodingAgent } from '../types'
2- import { build_agent_prompt , check_command_exists } from '../utils'
2+ import { build_agent_prompt , check_command_exists , get_progress_dots } from '../utils'
33
44let accumulated_output = ''
55let last_action_name = ''
@@ -48,9 +48,7 @@ export const muse_agent: CodingAgent = {
4848 last_action_name = action_name
4949 action_count = 1
5050 }
51- const extra_dots =
52- action_count > 1 ? ' ' + '.' . repeat ( action_count - 1 ) : ''
53- report_progress ( `${ action_name } ...${ extra_dots } ` )
51+ report_progress ( `${ action_name } ${ get_progress_dots ( action_count ) } ` )
5452 } else if (
5553 parsed . type === 'status' ||
5654 payload . type === 'status' ||
Original file line number Diff line number Diff line change 11import { CodingAgent } from '../types'
2- import { build_agent_prompt , check_command_exists } from '../utils'
2+ import { build_agent_prompt , check_command_exists , get_progress_dots } from '../utils'
33
44let last_action_name = ''
55let action_count = 0
@@ -33,9 +33,7 @@ export const opencode_agent: CodingAgent = {
3333 last_action_name = action_name
3434 action_count = 1
3535 }
36- const extra_dots =
37- action_count > 1 ? ' ' + '.' . repeat ( action_count - 1 ) : ''
38- report_progress ( `${ action_name } ...${ extra_dots } ` )
36+ report_progress ( `${ action_name } ${ get_progress_dots ( action_count ) } ` )
3937 } else if ( parsed . type == 'result' && parsed . result ) {
4038 last_action_name = ''
4139 action_count = 0
Original file line number Diff line number Diff line change @@ -40,3 +40,10 @@ export const format_duration = (ms: number): string => {
4040
4141 return parts . join ( ' ' )
4242}
43+
44+ export const get_progress_dots = ( action_count : number ) : string => {
45+ const cycle = ( action_count - 1 ) % 3
46+ if ( cycle === 0 ) return '...'
47+ if ( cycle === 1 ) return '....'
48+ return '..'
49+ }
You can’t perform that action at this time.
0 commit comments