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