lsp_tools_show_incorrect_status_on_Windows #8098

Open
opened 2026-02-16 18:09:09 -05:00 by yindo · 1 comment
Owner

Originally created by @tancem-sys on GitHub (Jan 30, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description
lsp_servers and lsp_diagnostics tools incorrectly report that TypeScript LSP is not installed on Windows, even though LSP server is successfully running in the background.
Environment Information

  • OS: Windows 11
  • Node.js: v22.13.0 (via nvm4w)
  • npm global path: C:\nvm4w\nodejs
  • OpenCode version: 1.1.42 (latest)
  • Project: NestJS backend with TypeScript 5.9.3
    Problem
    Evidence of LSP Working (from logs)
    When running opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG, logs show:
    INFO ... service=lsp.server tsserver=F:\Code\Projects\xiaofupo\WalletPro\backend\node_modules\typescript\lib\tsserver.js typescript server
    INFO ... service=lsp.serverID=typescript spawned lsp server
    INFO ... service=lsp.client serverID=typescript starting client
    INFO ... service=lsp.client serverID=typescript initialized
    INFO ... service=bus type=lsp.client.diagnostics unsubscribing{}
    This proves that:
  • LSP server successfully spawns
  • LSP client successfully initializes
  • Diagnostics are returned (empty object {} = no errors)
  • LSP server properly shuts down

Tools Report Incorrect Status

Despite the above evidence:
lsp_servers output:
typescript not installed - .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts
lsp_diagnostics output:
Error: LSP server 'typescript' is configured but NOT INSTALLED.
Command not found: typescript-language-server
To install:
npm install -g typescript-language-server typescript
This is clearly incorrect as LSP is running and functioning.

Steps to Reproduce

  1. Navigate to a project directory containing .ts files (e.g., backend/)
  2. Run: opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG
  3. Observe logs showing successful LSP initialization
  4. Run: lsp_servers → shows typescript [not installed]
  5. Run: lsp_diagnostics <file> → reports error about command not found

Expected Behavior

lsp_servers should show typescript [installed] when LSP server is running.
lsp_diagnostics should execute diagnostics without path errors.

Additional Context

  • The project has typescript dependency in package.json
  • The project has typescript-language-server in node_modules (v5.1.3)
  • LSP works correctly when invoked via opencode debug lsp diagnostics
  • Similar issues reported: #7270 (jdtls lsp server does not work properly in a window environment)
Originally created by @tancem-sys on GitHub (Jan 30, 2026). Originally assigned to: @rekram1-node on GitHub. Description `lsp_servers` and `lsp_diagnostics` tools incorrectly report that TypeScript LSP is not installed on Windows, even though LSP server is successfully running in the background. Environment Information - **OS**: Windows 11 - **Node.js**: v22.13.0 (via nvm4w) - **npm global path**: `C:\nvm4w\nodejs` - **OpenCode version**: 1.1.42 (latest) - **Project**: NestJS backend with TypeScript 5.9.3 Problem Evidence of LSP Working (from logs) When running `opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG`, logs show: INFO ... service=lsp.server tsserver=F:\Code\Projects\xiaofupo\WalletPro\backend\node_modules\typescript\lib\tsserver.js typescript server INFO ... service=lsp.serverID=typescript spawned lsp server INFO ... service=lsp.client serverID=typescript starting client INFO ... service=lsp.client serverID=typescript initialized INFO ... service=bus type=lsp.client.diagnostics unsubscribing{} This proves that: - ✅ LSP server successfully spawns - ✅ LSP client successfully initializes - ✅ Diagnostics are returned (empty object `{}` = no errors) - ✅ LSP server properly shuts down ### Tools Report Incorrect Status Despite the above evidence: **lsp_servers output:** typescript not installed - .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts **lsp_diagnostics output:** Error: LSP server 'typescript' is configured but NOT INSTALLED. Command not found: typescript-language-server To install: npm install -g typescript-language-server typescript This is clearly incorrect as LSP is running and functioning. ## Steps to Reproduce 1. Navigate to a project directory containing `.ts` files (e.g., `backend/`) 2. Run: `opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG` 3. Observe logs showing successful LSP initialization 4. Run: `lsp_servers` → shows `typescript [not installed]` 5. Run: `lsp_diagnostics <file>` → reports error about command not found ## Expected Behavior `lsp_servers` should show `typescript [installed]` when LSP server is running. `lsp_diagnostics` should execute diagnostics without path errors. ## Additional Context - The project has `typescript` dependency in `package.json` - The project has `typescript-language-server` in `node_modules` (v5.1.3) - LSP works correctly when invoked via `opencode debug lsp diagnostics` - Similar issues reported: #7270 (jdtls lsp server does not work properly in a window environment)
yindo added the windows label 2026-02-16 18:09:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 30, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11045: LSP fails on Windows due to path mismatch errors - similar Windows LSP path/availability check issues
  • #7270: jdtls lsp server does not work properly in a window environment - same pattern of LSP working but being reported as not installed on Windows
  • #6861: Dart LSP fails on Windows: 'Command not found' despite dart being in PATH - identical issue pattern with command availability checks failing on Windows
  • #11260: When using lsp to inspect Python files in Windows, encounter the error about pyright-langserver - another LSP command not found error on Windows despite tool being available
  • #10642: Windows 11, opencode can not use csharp lsp - related Windows LSP availability issue

These issues all follow the same pattern: LSP servers are installed and functioning on Windows, but OpenCode's availability check incorrectly reports them as not installed. The root cause appears to be in how the LSP availability checks handle Windows paths and command resolution.

Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Jan 30, 2026): This issue might be a duplicate of existing issues. Please check: - #11045: LSP fails on Windows due to path mismatch errors - similar Windows LSP path/availability check issues - #7270: jdtls lsp server does not work properly in a window environment - same pattern of LSP working but being reported as not installed on Windows - #6861: Dart LSP fails on Windows: 'Command not found' despite dart being in PATH - identical issue pattern with command availability checks failing on Windows - #11260: When using lsp to inspect Python files in Windows, encounter the error about pyright-langserver - another LSP command not found error on Windows despite tool being available - #10642: Windows 11, opencode can not use csharp lsp - related Windows LSP availability issue These issues all follow the same pattern: LSP servers are installed and functioning on Windows, but OpenCode's availability check incorrectly reports them as not installed. The root cause appears to be in how the LSP availability checks handle Windows paths and command resolution. Feel free to ignore if your specific case differs from these.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8098