@@ -121,12 +121,10 @@ func (l *lsTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error) {
121 searchPath = l.workingDir
121 searchPath = l.workingDir
124− if searchPath == "~" {
124+ var err error
125− homeDir, err := os.UserHomeDir()
125+ searchPath, err = fsext.Expand(searchPath)
126− if err != nil {
126+ if err != nil {
127− return ToolResponse{}, fmt.Errorf("error resolving home directory: %w", err)
127+ return ToolResponse{}, fmt.Errorf("error expanding path: %w", err)
129− searchPath = homeDir
132 if !filepath.IsAbs(searchPath) {
130 if !filepath.IsAbs(searchPath) {