From b3a3a4d90368bbcf33bf4753e0219d3f03f3fc16 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 31 Oct 2026 12:01:07 +0100 Subject: [PATCH] fix(server): return project suggestion roots in the form project.add stores Git reports Windows repo roots with forward slashes, so an added suggestion kept showing because its path never matched the new project's root. --- packages/server/src/server/project-suggestions.test.ts | 3 ++- packages/server/src/server/project-suggestions.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/server/project-suggestions.test.ts b/packages/server/src/server/project-suggestions.test.ts index 0a2e07af56..d637ee2ea1 100644 --- a/packages/server/src/server/project-suggestions.test.ts +++ b/packages/server/src/server/project-suggestions.test.ts @@ -88,7 +88,8 @@ describe("listProjectSuggestions", () => { let gitService: WorkspaceGitServiceImpl; beforeEach(() => { - root = realpathSync(mkdtempSync(path.join(tmpdir(), "project-suggestions-"))); + // The native realpath expands Windows short names (RUNNER~1), which git reports in full. + root = realpathSync.native(mkdtempSync(path.join(tmpdir(), "project-suggestions-"))); gitService = new WorkspaceGitServiceImpl({ logger: createTestLogger(), paseoHome: path.join(root, ".paseo"), diff --git a/packages/server/src/server/project-suggestions.ts b/packages/server/src/server/project-suggestions.ts index 2bc30cb1d2..4ad73585de 100644 --- a/packages/server/src/server/project-suggestions.ts +++ b/packages/server/src/server/project-suggestions.ts @@ -118,7 +118,8 @@ async function resolveProjectRoot( return null; } const checkout = await workspaceGitService.getCheckout(cwd); - const rootPath = checkout.mainRepoRoot ?? checkout.worktreeRoot ?? cwd; + // Git reports Windows roots with forward slashes; resolve to the form project.add keys by. + const rootPath = resolve(checkout.mainRepoRoot ?? checkout.worktreeRoot ?? cwd); if (rootPath !== cwd && !(await isDirectory(rootPath))) { return null; }