diff --git a/packages/coding-agent/src/core/tools/file-mutation-queue.ts b/packages/coding-agent/src/core/tools/file-mutation-queue.ts index 60f468fe..22011255 100644 --- a/packages/coding-agent/src/core/tools/file-mutation-queue.ts +++ b/packages/coding-agent/src/core/tools/file-mutation-queue.ts @@ -1,12 +1,12 @@ -import { realpath } from "node:fs/promises"; +import { realpathSync } from "node:fs"; import { resolve } from "node:path"; const fileMutationQueues = new Map>(); -async function getMutationQueueKey(filePath: string): Promise { +function getMutationQueueKey(filePath: string): string { const resolvedPath = resolve(filePath); try { - return await realpath(resolvedPath); + return realpathSync.native(resolvedPath); } catch { return resolvedPath; } @@ -17,7 +17,7 @@ async function getMutationQueueKey(filePath: string): Promise { * Operations for different files still run in parallel. */ export async function withFileMutationQueue(filePath: string, fn: () => Promise): Promise { - const key = await getMutationQueueKey(filePath); + const key = getMutationQueueKey(filePath); const currentQueue = fileMutationQueues.get(key) ?? Promise.resolve(); let releaseNext!: () => void;