Merge PR #7698: fix(coding-agent): build WSL mount fallback paths with POSIX semantics (@metaphorics)

This commit is contained in:
can1357
2026-08-05 21:50:24 +02:00
3 changed files with 8 additions and 3 deletions
+3
View File
@@ -22,6 +22,9 @@
### Fixed
- Fixed repeated `/mcp reauth` commands getting stuck behind the previous unfinished MCP OAuth login; a new reauthorization now cancels and cleans up the prior flow before starting its replacement.
### Fixed
- WSL host-home resolution now builds `/mnt/<drive>/...` fallback paths with POSIX semantics regardless of the host platform, instead of the platform-dependent `path` module ([#3779](https://github.com/can1357/oh-my-pi/issues/3779)).
## [17.2.9] - 2026-08-05
@@ -44,12 +44,14 @@ function isWsl(platform: NodeJS.Platform, env: NodeJS.ProcessEnv): boolean {
function convertWindowsPathToDefaultWslMount(windowsPath: string): string | undefined {
const trimmed = windowsPath.trim();
if (trimmed.length === 0) return undefined;
if (path.isAbsolute(trimmed)) return path.normalize(trimmed);
// The result is always a WSL (POSIX) path, so build it with posix
// semantics regardless of the host platform.
if (path.posix.isAbsolute(trimmed)) return path.posix.normalize(trimmed);
const match = WINDOWS_DRIVE_PROFILE_PATTERN.exec(trimmed);
if (!match) return undefined;
const [, drive, rest] = match;
const segments = rest.replace(/\\/g, "/").split("/").filter(Boolean);
return path.join("/mnt", drive.toLowerCase(), ...segments);
return path.posix.join("/mnt", drive.toLowerCase(), ...segments);
}
function resolveWithWslPath(windowsPath: string): string | undefined {
+1 -1
View File
@@ -284,7 +284,7 @@ describe("skills", () => {
wslPath: () => undefined,
});
expect(resolved).toBe(path.join("/mnt", "c", "Users", "alice"));
expect(resolved).toBe("/mnt/c/Users/alice");
});
it("resolves the Windows profile through interop when USERPROFILE is not exported (#3779)", () => {