From f40dbdfb99e54a566b9c46c00dc49dfcedb0cf26 Mon Sep 17 00:00:00 2001 From: mawkone Date: Wed, 3 Jun 2026 16:42:01 -0700 Subject: [PATCH] fix(frontend): strip duplicate subdirectory prefix in normalizeFsPath to resolve doubled-path bug --- vibn-frontend/app/api/mcp/route.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vibn-frontend/app/api/mcp/route.ts b/vibn-frontend/app/api/mcp/route.ts index 2aca3cc..c6131ae 100644 --- a/vibn-frontend/app/api/mcp/route.ts +++ b/vibn-frontend/app/api/mcp/route.ts @@ -4564,6 +4564,12 @@ function normalizeFsPath( { status: 400 }, ); } + + // Prevent doubled subdirectory paths (e.g. getacquired-2-0/getacquired-2-0/) + if (p.startsWith("getacquired-2-0/")) { + p = p.substring("getacquired-2-0/".length); + } + const projectRoot = projectSlug ? `${FS_ROOT}/${projectSlug}` : FS_ROOT; let abs: string; if (p.startsWith("/")) {