Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/tools/implementations/lsTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ export function resolveLsToolDirPath(dirPath: string | undefined) {
if (!dirPath || dirPath === ".") {
return ".";
}
// Don't strip leading slash from absolute paths - let the resolver handle it
if (dirPath.startsWith(".") && !dirPath.startsWith("./")) {
return dirPath.slice(1);
}
return dirPath.replace(/\\/g, "/");
}

Expand Down
13 changes: 13 additions & 0 deletions core/tools/implementations/lsTool.vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ test("resolveLsToolDirPath preserves forward slashes", () => {
expect(resolveLsToolDirPath("path/to/dir")).toBe("path/to/dir");
});

test("resolveLsToolDirPath preserves hidden directory paths", () => {
expect(resolveLsToolDirPath(".continue/rules")).toBe(".continue/rules");
});

test("resolveLsToolDirPath preserves hidden directory name only", () => {
expect(resolveLsToolDirPath(".git")).toBe(".git");
});

test("resolveLsToolDirPath preserves parent directory references", () => {
expect(resolveLsToolDirPath("..")).toBe("..");
expect(resolveLsToolDirPath("../foo")).toBe("../foo");
});

test("lsToolImpl truncates output when entries exceed MAX_LS_TOOL_LINES", async () => {
// Generate more than MAX_LS_TOOL_LINES entries (which is 200)
const mockEntries = Array.from({ length: 250 }, (_, i) => `file${i}.txt`);
Expand Down
Loading