diff --git a/core/tools/implementations/lsTool.ts b/core/tools/implementations/lsTool.ts index c8c75306092..8fc9a044e22 100644 --- a/core/tools/implementations/lsTool.ts +++ b/core/tools/implementations/lsTool.ts @@ -2,12 +2,12 @@ import ignore from "ignore"; import { ToolImpl } from "."; import { walkDir } from "../../indexing/walkDir"; -import { resolveInputPath } from "../../util/pathResolver"; import { ContinueError, ContinueErrorReason } from "../../util/errors"; +import { resolveInputPath } from "../../util/pathResolver"; export function resolveLsToolDirPath(dirPath: string | undefined) { if (!dirPath || dirPath === ".") { - return "/"; + return "."; } // Don't strip leading slash from absolute paths - let the resolver handle it if (dirPath.startsWith(".") && !dirPath.startsWith("./")) { diff --git a/core/tools/implementations/lsTool.vitest.ts b/core/tools/implementations/lsTool.vitest.ts index c3c571294d8..7ec20682715 100644 --- a/core/tools/implementations/lsTool.vitest.ts +++ b/core/tools/implementations/lsTool.vitest.ts @@ -13,15 +13,15 @@ const mockExtras = { } as unknown as ToolExtras; test("resolveLsToolDirPath handles undefined path", () => { - expect(resolveLsToolDirPath(undefined)).toBe("/"); + expect(resolveLsToolDirPath(undefined)).toBe("."); }); test("resolveLsToolDirPath handles empty string", () => { - expect(resolveLsToolDirPath("")).toBe("/"); + expect(resolveLsToolDirPath("")).toBe("."); }); test("resolveLsToolDirPath handles dot", () => { - expect(resolveLsToolDirPath(".")).toBe("/"); + expect(resolveLsToolDirPath(".")).toBe("."); }); test("resolveLsToolDirPath handles dot relative", () => {