Fix grep and glob tools

This commit is contained in:
Alex Gleason committed 2026-01-21 21:45:30 -06:00
1 parent 2971a91fbb
commit bb28e71e50
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -48,7 +48,10 @@ export class GrepTool implements Tool<GrepParams> {
throw new Error("pattern is required");
}
const searchPath = args.path ? join(this.cwd, args.path) : this.cwd;
// If path is absolute, use it directly; otherwise join with cwd
const searchPath = args.path
? (args.path.startsWith('/') ? args.path : join(this.cwd, args.path))
: this.cwd;
try {
// Check if search path exists