From d38ad0cd6bd1c83151f2ae5ce919eb0991d9e59a Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 21 Mar 2026 23:57:24 +0100 Subject: [PATCH] fix(coding-agent): preserve file mutation queue ordering --- .../coding-agent/src/core/tools/file-mutation-queue.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;