diff --git a/plugins/codex/scripts/lib/broker-endpoint.mjs b/plugins/codex/scripts/lib/broker-endpoint.mjs index 8abdcc71..664c5849 100644 --- a/plugins/codex/scripts/lib/broker-endpoint.mjs +++ b/plugins/codex/scripts/lib/broker-endpoint.mjs @@ -13,7 +13,7 @@ export function createBrokerEndpoint(sessionDir, platform = process.platform) { return `pipe:\\\\.\\pipe\\${pipeName}`; } - return `unix:${path.join(sessionDir, "broker.sock")}`; + return `unix:${path.posix.join(sessionDir, "broker.sock")}`; } export function parseBrokerEndpoint(endpoint) { diff --git a/tests/git.test.mjs b/tests/git.test.mjs index 14ff2576..085cbad5 100644 --- a/tests/git.test.mjs +++ b/tests/git.test.mjs @@ -103,13 +103,21 @@ test("collectReviewContext skips untracked directories in working tree review", assert.match(context.content, /### \.claude\/worktrees\/agent-test\/\n\(skipped: directory\)/); }); -test("collectReviewContext skips broken untracked symlinks instead of crashing", () => { +test("collectReviewContext skips broken untracked symlinks instead of crashing", (t) => { const cwd = makeTempDir(); initGitRepo(cwd); fs.writeFileSync(path.join(cwd, "app.js"), "console.log('v1');\n"); run("git", ["add", "app.js"], { cwd }); run("git", ["commit", "-m", "init"], { cwd }); - fs.symlinkSync("missing-target", path.join(cwd, "broken-link")); + try { + fs.symlinkSync("missing-target", path.join(cwd, "broken-link")); + } catch (err) { + if (process.platform === "win32" && err.code === "EPERM") { + t.skip("Skipping symlink test: Windows requires Developer Mode or Administrator privileges to create symlinks."); + return; + } + throw err; + } const target = resolveReviewTarget(cwd, {}); const context = collectReviewContext(cwd, target); diff --git a/tests/runtime.test.mjs b/tests/runtime.test.mjs index 8f276835..30bef6ef 100644 --- a/tests/runtime.test.mjs +++ b/tests/runtime.test.mjs @@ -47,7 +47,11 @@ test("setup reports ready when fake codex is installed and authenticated", () => test("setup is ready without npm when Codex is already installed and authenticated", () => { const binDir = makeTempDir(); installFakeCodex(binDir); - fs.symlinkSync(process.execPath, path.join(binDir, "node")); + if (process.platform === "win32") { + fs.writeFileSync(path.join(binDir, "node.cmd"), `@echo off\n"${process.execPath}" %*\n`); + } else { + fs.symlinkSync(process.execPath, path.join(binDir, "node")); + } const result = run("node", [SCRIPT, "setup", "--json"], { cwd: ROOT,