Skip to content

fix(lsp): recognize Windows launcher shims during binary discovery#29310

Closed
Sylw3ster wants to merge 1 commit into
NousResearch:mainfrom
Sylw3ster:fix/lsp-windows-binary-wrapper-discovery
Closed

fix(lsp): recognize Windows launcher shims during binary discovery#29310
Sylw3ster wants to merge 1 commit into
NousResearch:mainfrom
Sylw3ster:fix/lsp-windows-binary-wrapper-discovery

Conversation

@Sylw3ster

@Sylw3ster Sylw3ster commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

On native Windows, an LSP server install could succeed while later discovery still reported the server as missing.

The npm install path already handled Windows .cmd shims during the initial install, but the shared probe path only checked the bare binary name afterward. That meant follow-up paths like detect_status(), manual/off strategy probes, hermes lsp which, and backend warning checks could miss an installed launcher such as pyright-langserver.cmd.

This also affected pip-based LSP installs because Python console scripts commonly land under Scripts/ with .exe launchers on Windows, while the installer only searched python-packages/bin/.

Changes

  • Centralized platform-native LSP binary candidates in agent/lsp/install.py.
  • Added staged and PATH discovery for Windows launcher variants:
    • .cmd
    • .exe
    • .bat
  • Reused the same candidate resolution for npm install output under node_modules/.bin.
  • Added pip console script discovery under Windows python-packages/Scripts/.
  • Aligned hermes lsp which and bash-language-server backend warning detection with the shared _existing_binary() path.
  • Added regression tests for:
    • staged .cmd wrappers being treated as installed
    • pip Scripts/*.exe launchers being linked into Hermes’ LSP bin directory

Tests

git diff --check -- agent\lsp\install.py agent\lsp\cli.py tests\agent\lsp\test_install_and_lint_fixes.py
uv run --extra dev pytest -o addopts= tests\agent\lsp\test_install_and_lint_fixes.py -q
uv run --extra dev ruff check agent\lsp\install.py agent\lsp\cli.py tests\agent\lsp\test_install_and_lint_fixes.py

git diff --check: passed
pytest: 14 passed in 0.87s
ruff: All checks passed!

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder labels May 20, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #35250 — your discovery-side fix was cherry-picked onto current main as 460771b with your authorship preserved. It pairs with the spawn-side fix (#34865) for full native-Windows LSP support. Thanks! #35250

@teknium1 teknium1 closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants