Skip to content

Commit 5ef51e4

Browse files
author
Christian Anke
committed
bug(tool-call): lsTools should not default to "/", use "." instead
When a tool call want's to list "." it is very likely refering to the current directory and not the root-directory ("/"). Also if the directory parameter is missing it makes more sense to list the current work dir, not root ("/").
1 parent 316df75 commit 5ef51e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/tools/implementations/lsTool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import ignore from "ignore";
22

33
import { ToolImpl } from ".";
44
import { walkDir } from "../../indexing/walkDir";
5-
import { resolveInputPath } from "../../util/pathResolver";
65
import { ContinueError, ContinueErrorReason } from "../../util/errors";
6+
import { resolveInputPath } from "../../util/pathResolver";
77

88
export function resolveLsToolDirPath(dirPath: string | undefined) {
99
if (!dirPath || dirPath === ".") {
10-
return "/";
10+
return ".";
1111
}
1212
// Don't strip leading slash from absolute paths - let the resolver handle it
1313
if (dirPath.startsWith(".") && !dirPath.startsWith("./")) {

0 commit comments

Comments
 (0)