fix issue with lsTool listing fs root instead of current folder

This commit is contained in:
Volodymyr Bychkovyak 2026-01-06 22:53:36 -06:00
parent a0fdf94861
commit c078d772eb
2 changed files with 5 additions and 5 deletions

View file

@ -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("./")) {

View file

@ -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", () => {