fix: fix misc windows issues (#323)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-19 14:01:03 -08:00
committed by GitHub
parent 66c4842375
commit e5281fb06d
12 changed files with 371 additions and 11 deletions

View File

@@ -29,7 +29,9 @@ export async function edit(args: EditArgs): Promise<EditResult> {
"No changes to make: old_string and new_string are exactly the same.",
);
try {
const content = await fs.readFile(resolvedPath, "utf-8");
const rawContent = await fs.readFile(resolvedPath, "utf-8");
// Normalize line endings to LF for consistent matching (Windows uses CRLF)
const content = rawContent.replace(/\r\n/g, "\n");
const occurrences = content.split(old_string).length - 1;
if (occurrences === 0)
throw new Error(