Skip to content

Commit 59e5d32

Browse files
committed
fix(agent-ui): add search_files tool rendering support
Map search_files to command_result renderer in workspace panel and add inline argument display (pattern + path) in chat tool calls. Also add search_files to file-related tools list and display name mapping. Previously search_files fell through to the default JSON renderer, showing raw JSON instead of formatted output.
1 parent 239b654 commit 59e5d32

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

  • multimodal/tarko/agent-ui/src

multimodal/tarko/agent-ui/src/common/utils/tool-renderers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const TOOL_TO_RENDERER_CONFIG: ToolToRendererCondition[] = [
1515
{ toolName: 'edit_file', renderer: 'diff_result' },
1616
{ toolName: 'run_command', renderer: 'command_result' },
1717
{ toolName: 'run_script', renderer: 'script_result' },
18+
{ toolName: 'search_files', renderer: 'command_result' },
1819
{ toolName: 'LinkReader', renderer: 'link_reader' },
1920
{ toolName: 'Search', renderer: 'search_result' },
2021
{ toolName: 'execute_bash', renderer: 'command_result' },

multimodal/tarko/agent-ui/src/standalone/chat/Message/components/ToolCalls.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ export const ToolCalls: React.FC<ToolCallsProps> = ({
136136
: '';
137137
case 'run_command':
138138
return args.command || (status === 'constructing' ? 'preparing command...' : '');
139+
case 'search_files':
140+
return args.pattern
141+
? `${args.pattern}${args.path ? ` in ${args.path}` : ''}`
142+
: status === 'constructing'
143+
? 'preparing search...'
144+
: '';
139145
case 'read_file':
140146
case 'write_file':
141147
case 'edit_file':
@@ -201,6 +207,8 @@ export const ToolCalls: React.FC<ToolCallsProps> = ({
201207
return 'Web Search';
202208
case 'list_directory':
203209
return 'List Files';
210+
case 'search_files':
211+
return 'Search Files';
204212
case 'run_command':
205213
return 'Run Command';
206214
case 'read_file':
@@ -223,6 +231,7 @@ export const ToolCalls: React.FC<ToolCallsProps> = ({
223231
'write_file',
224232
'edit_file',
225233
'list_directory',
234+
'search_files',
226235
'str_replace_editor',
227236
];
228237
return fileTools.includes(toolName);

0 commit comments

Comments
 (0)