From 40474d4e905efe6e109403827ae343745e157347 Mon Sep 17 00:00:00 2001 From: Mayank Pandey Date: Sun, 5 Jul 2026 11:42:24 +0530 Subject: [PATCH 1/2] fix(windows): resolve cross-platform test compatibility and path separation issues --- commandsexecute.py | 119 ++++++++++++++++++ plugins/codex/scripts/lib/broker-endpoint.mjs | 2 +- tests/git.test.mjs | 12 +- tests/runtime.test.mjs | 6 +- 4 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 commandsexecute.py diff --git a/commandsexecute.py b/commandsexecute.py new file mode 100644 index 00000000..2ef9fa5f --- /dev/null +++ b/commandsexecute.py @@ -0,0 +1,119 @@ +# Codex Plugin Test Execution Records +# Run one at a time. Updated manually. + +test_results = [ + { + "test_file": "tests/broker-endpoint.test.mjs", + "command": "node --test tests/broker-endpoint.test.mjs", + "status": "PASS", + "tests_passed": [ + "createBrokerEndpoint uses Unix sockets on non-Windows", + "createBrokerEndpoint uses named pipes on Windows" + ], + "tests_failed": [], + "duration_ms": 172.593 + }, + { + "test_file": "tests/bump-version.test.mjs", + "command": "node --test tests/bump-version.test.mjs", + "status": "PASS", + "tests_passed": [ + "bump-version updates every release manifest", + "bump-version check mode reports stale metadata" + ], + "tests_failed": [], + "duration_ms": 552.3207 + }, + { + "test_file": "tests/commands.test.mjs", + "command": "node --test tests/commands.test.mjs", + "status": "PASS", + "tests_passed": [ + "review command uses AskUserQuestion and background Bash while staying review-only", + "adversarial review command uses AskUserQuestion and background Bash while staying review-only", + "continue is not exposed as a user-facing command", + "rescue command absorbs continue semantics", + "transfer, result, and cancel commands are exposed as deterministic runtime entrypoints", + "internal docs use task terminology for rescue runs", + "hooks keep session-end cleanup and stop gating enabled", + "setup command can offer Codex install and still points users to codex login" + ], + "tests_failed": [], + "duration_ms": 183.063 + }, + { + "test_file": "tests/git.test.mjs", + "command": "node --test tests/git.test.mjs", + "status": "PASS", + "tests_passed": [ + "resolveReviewTarget prefers working tree when repo is dirty", + "resolveReviewTarget falls back to branch diff when repo is clean", + "resolveReviewTarget honors explicit base overrides", + "resolveReviewTarget requires an explicit base when no default branch can be inferred", + "collectReviewContext keeps inline diffs for tiny adversarial reviews", + "collectReviewContext skips untracked directories in working tree review", + "collectReviewContext falls back to lightweight context for larger adversarial reviews", + "collectReviewContext falls back to lightweight context for oversized single-file diffs", + "collectReviewContext keeps untracked file content in lightweight working tree context" + ], + "tests_skipped": [ + "collectReviewContext skips broken untracked symlinks instead of crashing" + ], + "tests_failed": [], + "duration_ms": 28943.959 + }, + { + "test_file": "tests/process.test.mjs", + "command": "node --test tests/process.test.mjs", + "status": "PASS", + "tests_passed": [ + "terminateProcessTree uses taskkill on Windows", + "terminateProcessTree treats missing Windows processes as already stopped" + ], + "tests_failed": [], + "duration_ms": 165.4144 + }, + { + "test_file": "tests/render.test.mjs", + "command": "node --test tests/render.test.mjs", + "status": "PASS", + "tests_passed": [ + "renderReviewResult degrades gracefully when JSON is missing required review fields", + "renderStoredJobResult prefers rendered output for structured review jobs" + ], + "tests_failed": [], + "duration_ms": 142.3464 + }, + { + "test_file": "tests/state.test.mjs", + "command": "node --test tests/state.test.mjs", + "status": "PASS", + "tests_passed": [ + "resolveStateDir uses a temp-backed per-workspace directory", + "resolveStateDir uses CLAUDE_PLUGIN_DATA when it is provided", + "saveState prunes dropped job artifacts when indexed jobs exceed the cap" + ], + "tests_failed": [], + "duration_ms": 31785.7201 + }, + { + "test_file": "tests/runtime.test.mjs", + "command": "node --test tests/runtime.test.mjs", + "status": "PARTIAL_PASS", + "tests_passed": [ + "session start hook exports the Claude session id, transcript path, and plugin data dir", + "task logs subagent reasoning and messages with a subagent prefix", + "task waits for the main thread to complete before returning the final result", + "task ignores later subagent messages when choosing the final returned output", + "task can finish after subagent work even if the parent turn/completed event is missing", + "task using the shared broker still completes when Codex spawns subagents", + "cancel stops an active background job and marks it cancelled", + "cancel without a job id ignores active jobs from other Claude sessions", + "cancel with a job id can still target an active job from another Claude session" + ], + "tests_failed": [ + "4 resource/event loop timeout-related tests failed on 32-bit Windows concurrency" + ], + "duration_ms": 536342.3297 + } +] 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, From 0d7964cecbcd6e32fd476876171e18a1b8016e9a Mon Sep 17 00:00:00 2001 From: Mayank Pandey Date: Sun, 5 Jul 2026 11:47:38 +0530 Subject: [PATCH 2/2] chore: remove temporary test execution records --- commandsexecute.py | 119 --------------------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 commandsexecute.py diff --git a/commandsexecute.py b/commandsexecute.py deleted file mode 100644 index 2ef9fa5f..00000000 --- a/commandsexecute.py +++ /dev/null @@ -1,119 +0,0 @@ -# Codex Plugin Test Execution Records -# Run one at a time. Updated manually. - -test_results = [ - { - "test_file": "tests/broker-endpoint.test.mjs", - "command": "node --test tests/broker-endpoint.test.mjs", - "status": "PASS", - "tests_passed": [ - "createBrokerEndpoint uses Unix sockets on non-Windows", - "createBrokerEndpoint uses named pipes on Windows" - ], - "tests_failed": [], - "duration_ms": 172.593 - }, - { - "test_file": "tests/bump-version.test.mjs", - "command": "node --test tests/bump-version.test.mjs", - "status": "PASS", - "tests_passed": [ - "bump-version updates every release manifest", - "bump-version check mode reports stale metadata" - ], - "tests_failed": [], - "duration_ms": 552.3207 - }, - { - "test_file": "tests/commands.test.mjs", - "command": "node --test tests/commands.test.mjs", - "status": "PASS", - "tests_passed": [ - "review command uses AskUserQuestion and background Bash while staying review-only", - "adversarial review command uses AskUserQuestion and background Bash while staying review-only", - "continue is not exposed as a user-facing command", - "rescue command absorbs continue semantics", - "transfer, result, and cancel commands are exposed as deterministic runtime entrypoints", - "internal docs use task terminology for rescue runs", - "hooks keep session-end cleanup and stop gating enabled", - "setup command can offer Codex install and still points users to codex login" - ], - "tests_failed": [], - "duration_ms": 183.063 - }, - { - "test_file": "tests/git.test.mjs", - "command": "node --test tests/git.test.mjs", - "status": "PASS", - "tests_passed": [ - "resolveReviewTarget prefers working tree when repo is dirty", - "resolveReviewTarget falls back to branch diff when repo is clean", - "resolveReviewTarget honors explicit base overrides", - "resolveReviewTarget requires an explicit base when no default branch can be inferred", - "collectReviewContext keeps inline diffs for tiny adversarial reviews", - "collectReviewContext skips untracked directories in working tree review", - "collectReviewContext falls back to lightweight context for larger adversarial reviews", - "collectReviewContext falls back to lightweight context for oversized single-file diffs", - "collectReviewContext keeps untracked file content in lightweight working tree context" - ], - "tests_skipped": [ - "collectReviewContext skips broken untracked symlinks instead of crashing" - ], - "tests_failed": [], - "duration_ms": 28943.959 - }, - { - "test_file": "tests/process.test.mjs", - "command": "node --test tests/process.test.mjs", - "status": "PASS", - "tests_passed": [ - "terminateProcessTree uses taskkill on Windows", - "terminateProcessTree treats missing Windows processes as already stopped" - ], - "tests_failed": [], - "duration_ms": 165.4144 - }, - { - "test_file": "tests/render.test.mjs", - "command": "node --test tests/render.test.mjs", - "status": "PASS", - "tests_passed": [ - "renderReviewResult degrades gracefully when JSON is missing required review fields", - "renderStoredJobResult prefers rendered output for structured review jobs" - ], - "tests_failed": [], - "duration_ms": 142.3464 - }, - { - "test_file": "tests/state.test.mjs", - "command": "node --test tests/state.test.mjs", - "status": "PASS", - "tests_passed": [ - "resolveStateDir uses a temp-backed per-workspace directory", - "resolveStateDir uses CLAUDE_PLUGIN_DATA when it is provided", - "saveState prunes dropped job artifacts when indexed jobs exceed the cap" - ], - "tests_failed": [], - "duration_ms": 31785.7201 - }, - { - "test_file": "tests/runtime.test.mjs", - "command": "node --test tests/runtime.test.mjs", - "status": "PARTIAL_PASS", - "tests_passed": [ - "session start hook exports the Claude session id, transcript path, and plugin data dir", - "task logs subagent reasoning and messages with a subagent prefix", - "task waits for the main thread to complete before returning the final result", - "task ignores later subagent messages when choosing the final returned output", - "task can finish after subagent work even if the parent turn/completed event is missing", - "task using the shared broker still completes when Codex spawns subagents", - "cancel stops an active background job and marks it cancelled", - "cancel without a job id ignores active jobs from other Claude sessions", - "cancel with a job id can still target an active job from another Claude session" - ], - "tests_failed": [ - "4 resource/event loop timeout-related tests failed on 32-bit Windows concurrency" - ], - "duration_ms": 536342.3297 - } -]