Files
hermes-agent/contributors/emails/gameoverhf12@gmail.com
BrierAinz d6e5cda29c fix(lsp): probe Windows .cmd/.exe/.bat wrappers before npm's POSIX shim (#86445)
npm writes a POSIX `#!/bin/sh` shim under the bare binary name next to its
`.cmd` wrapper. `_native_binary_candidates` listed the bare name first and
`os.access(X_OK)` is always true on Windows, so `_existing_binary` handed the
shell script to CreateProcess (WinError 193) and `_install_npm` staged the
shim instead of the wrapper. Python/TS/YAML diagnostics were silently gone
for the whole session on native Windows.

- wrappers first, bare name last; the ordering takes `is_windows` as data so
  the invariant is testable on every host
- npm's `%~dp0`-relative `.cmd`/`.bat` wrappers stay in `node_modules/.bin`
  (a copy in `lsp/bin/` points at nothing); `_existing_binary` probes there
- PATH probing tries the wrappers before the bare name too
- pyright: the langserver sibling keeps the resolved binary's suffix

Salvages #73088 by @BrierAinz (same diagnosis and staging fix, rebuilt on
the current install.py shape).
2026-09-19 01:30:13 -07:00

3 lines
30 B
Plaintext

BrierAinz
# PR #73088 salvage