From 5512aba1dd768fbbe20e81f84e5145f2d70df04c Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Mon, 10 Aug 2026 00:14:11 -0400 Subject: [PATCH] test(server): compare Windows workspace identity --- config/scripts/node-server-runtime-verifier.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/config/scripts/node-server-runtime-verifier.ts b/config/scripts/node-server-runtime-verifier.ts index 43cc911f372..5c2b7cfce7b 100644 --- a/config/scripts/node-server-runtime-verifier.ts +++ b/config/scripts/node-server-runtime-verifier.ts @@ -3,6 +3,7 @@ import { mkdtempSync, realpathSync } from 'node:fs' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import { removeHostTree } from '../../src/main/host-tree-removal' +import { normalizeRuntimePathForComparison } from '../../src/shared/cross-platform-path' import { decodePairingOffer, type PairingOffer } from '../../src/shared/pairing' import { sendRemoteRuntimeRequest } from '../../src/shared/remote-runtime-client' import type { RuntimeStatus, RuntimeTerminalRead } from '../../src/shared/runtime-types' @@ -219,11 +220,22 @@ async function verifyGitWorkspace(pairing: PairingOffer): Promise { { repo: `id:${added.repo.id}` } ) assert( - listed.worktrees.some((worktree) => worktree.path === gitPath), + listed.worktrees.some((worktree) => isSameExistingHostPath(worktree.path, gitPath)), 'Git worktree unavailable' ) } +function isSameExistingHostPath(left: string, right: string): boolean { + try { + return ( + normalizeRuntimePathForComparison(realpathSync.native(left)) === + normalizeRuntimePathForComparison(realpathSync.native(right)) + ) + } catch { + return false + } +} + async function verifyFolderWorkspaceAndTerminal(pairing: PairingOffer): Promise<{ handle: string marker: string