Skip to content

fix(windows): resolve and safely launch npm shims - #678

Open
css521 wants to merge 4 commits into
coollabsio:mainfrom
css521:fix/issue-675-windows-npm-shims
Open

fix(windows): resolve and safely launch npm shims#678
css521 wants to merge 4 commits into
coollabsio:mainfrom
css521:fix/issue-675-windows-npm-shims

Conversation

@css521

@css521 css521 commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • resolve PATH tools to Windows-runnable .exe, .cmd, or .bat candidates before spawning
  • keep host npm/npx flows out of WSL and hand their batch shims to Rust std::process for safe per-argument escaping, full command quoting, and cmd.exe /d
  • preserve the existing cmd.exe /C launch mode for agent backends whose Windows .cmd shims receive multiline chat prompts, because Rust's native batch path rejects CR/LF arguments
  • apply the shared resolver to prerequisites, npm-backed installers, CLI updates, agent-browser, and Caveman npx
  • document the two launch modes and add regression coverage for candidate selection, extensionless-to-.cmd redirection, spaced shim paths, launch planning, allowlisting, and bare npm/npx audits

Closes #675.

Validation

  • cd jean-core && cargo test -- platform::wsl (34 passed)
  • cd jean-core && cargo test -- windows_path_detection allowlist_key path_tool_command npm_and_npx_are_never_spawned_as_bare_program_names (10 passed)
  • rustfmt --edition 2021 --check jean-core/src/platform/wsl.rs jean-core/src/platform/cli_detect.rs
  • npx --yes prettier --check docs/developer/architecture-guide.md
  • git diff --check

@css521 css521 changed the title fix(windows): launch npm shims through cmd fix(windows): resolve and safely launch npm shims Aug 12, 2026
css521 added 2 commits August 12, 2026 18:32
One conflict, in jean-core/src/prerequisites.rs::version(): this branch
swapped silent_command() for path_tool_command() so Windows resolves npm.cmd
(issue coollabsio#675), while main only reformatted the same expression with rustfmt.
Both changes kept — the new helper inside main's formatting.

Checked that main introduced no new npm/npx launch sites that would also need
routing through path_tool_command(); the remaining silent_command() callers
launch git, sh, wsl.exe, xattr and friends, which are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Windows] npm/npx-backed operations fail because Jean launches bare commands instead of .cmd shims

1 participant