From ec94d02991acb8b26a077797bf37195d24a83c67 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 09:10:12 +0000 Subject: [PATCH 1/2] fix: correct cross-platform PATH splitting and dead code in executor resolver.ts: findOnPath() was splitting PATH using path.delimiter (which is ":" on Linux/macOS even when IS_WINDOWS is true in tests). Windows paths like "C:\dir" contain a literal ":" that the Linux delimiter would split on, causing the PATH walk to silently fail and fall through to the literal "commandcode" fallback. Fix: use IS_WINDOWS ? ";" : delimiter so the split character always matches the target platform, not the host OS. This makes the three Windows PATH-walk resolver tests pass on Linux/macOS. executor.ts: remove the unused IS_WINDOWS import (leftover from when spawn used shell:true on Windows) and correct the JSDoc that still claimed shell:true/false split by OS. https://claude.ai/code/session_01Qkq1tdzF4drY3DSg61CSAx --- src/executor.ts | 3 +-- src/resolver.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/executor.ts b/src/executor.ts index 34a5064..0f287cd 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -9,7 +9,6 @@ import { ExecutionOptions, CommandCodeResult } from "./types.js"; import { resolveCommandCodePath } from "./resolver.js"; import { executeMock } from "./mock.js"; import { - IS_WINDOWS, MAX_PARTIAL_OUTPUT_CHARS, STREAM_CHUNK_INTERVAL_MS, } from "./constants.js"; @@ -19,7 +18,7 @@ import { * * - Checks COMMANDCODE_MOCK env var and delegates to mock executor if set. * - Resolves the CLI binary path via the resolver module. - * - Spawns the process with shell: true on Windows, shell: false on Unix. + * - Spawns the process with shell: false on all platforms (resolver handles PATH/shim resolution). * - Always includes `--skip-onboarding` in the args. * - Applies timeout via AbortController + setTimeout. * - On timeout: SIGTERM → wait 2s → SIGKILL → collect partial output (up to 10,000 chars). diff --git a/src/resolver.ts b/src/resolver.ts index a11c355..207a85b 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -45,7 +45,7 @@ function findOnPath(name: string): string | null { ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";") : [""]; - for (const dir of pathEnv.split(delimiter)) { + for (const dir of pathEnv.split(IS_WINDOWS ? ";" : delimiter)) { if (!dir) continue; for (const ext of exts) { const candidate = join(dir, name + ext); From 06d0db8ad32a25aeb9f1f51fc9d7f5e2daad2384 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 09:10:53 +0000 Subject: [PATCH 2/2] chore: normalize package-lock.json with npm v10 Removes stale "peer": true metadata fields from several lockfile entries (npm v10 no longer emits this field for non-peer deps). https://claude.ai/code/session_01Qkq1tdzF4drY3DSg61CSAx --- package-lock.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 14baf96..38270f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -876,7 +876,6 @@ "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -1394,7 +1393,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -1901,7 +1899,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2433,7 +2430,6 @@ "integrity": "sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -2642,7 +2638,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" }