Skip to content

Commit bf60854

Browse files
committed
🤖 Ensure file_list displays directory paths with trailing slash
Add trailing slash to displayed path in FileListToolCall to clearly indicate it's a directory being listed. Only affects display - the actual tool arg remains unchanged.
1 parent 3a948a1 commit bf60854

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/tools/FileListToolCall.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ export const FileListToolCall: React.FC<FileListToolCallProps> = ({ args, result
101101

102102
const paramStr = params.length > 0 ? `(${params.join(", ")})` : "";
103103

104+
// Ensure path ends with / to indicate it's a directory
105+
const displayPath = args.path.endsWith("/") ? args.path : `${args.path}/`;
106+
104107
// Convert our status to shared ToolStatus type
105108
const toolStatus = isError ? "failed" : isPending ? "executing" : "completed";
106109

@@ -109,7 +112,7 @@ export const FileListToolCall: React.FC<FileListToolCallProps> = ({ args, result
109112
<ToolHeader onClick={toggleExpanded}>
110113
<ExpandIcon expanded={expanded}></ExpandIcon>
111114
<ToolIcon emoji="📖" toolName="file_list" />
112-
<PathText>{args.path}</PathText>
115+
<PathText>{displayPath}</PathText>
113116
{paramStr && <ParamsText>{paramStr}</ParamsText>}
114117
{isComplete && result && result.success && (
115118
<CountBadge>{result.total_count} entries</CountBadge>

0 commit comments

Comments
 (0)