Repository navigation
Description
Bug Report: LSP causes OpenCode desktop app to freeze/hang on file read
Summary
When LSP is enabled, the OpenCode desktop app (Windows) freezes completely whenever the app internally reads a file (e.g., via built-in file read tool). The freeze is immediate and total — the app becomes unresponsive and must be force-killed.
Environment
- OpenCode version: 1.15.3 (npm package) / exe version 1.3.13
- Platform: Windows
- Node.js: v24.14.0
- npm: 11.14.1
- Installation:
npm install -g opencode-ai
LSP Servers Tested
All 6 configured LSP servers were individually tested and confirmed working:
| LSP Server | Type | Result |
|---|---|---|
| marksman (Markdown) | Standalone binary (WinGet) | Individual process OK |
| docker-langserver (Dockerfile) | npm global | Individual process OK |
| vscode-json-languageserver (JSON) | npm global | Individual process OK |
| css-languageserver (CSS/SCSS/Less) | npm global | Individual process OK |
| html-languageserver (HTML) | npm global | Individual process OK |
| basedpyright (Python) | pip | Individual process OK |
All LSP server binaries execute correctly when tested independently (< 300ms response time). The issue is NOT in any specific LSP server.
Root Cause
The freeze occurs in OpenCode's built-in LSP client implementation, not in the LSP servers themselves. Evidence:
-
Not npm/environment related:
npm_config_user_agentenvironment variable contamination (npm/undefined) was suspected but disproven- npm, node, and all LSP server binaries work normally with the contaminated env var
- All LSP processes respond in < 300ms when spawned directly
-
Not LSP server specific:
- Tested with marksman only (simplest, standalone binary) — still freezes
- All LSP servers work fine individually
-
Not plugin related:
- Tested with only
oh-my-openagentplugin active (removed all others) — still freezes
- Tested with only
-
Not file-path specific:
- Does not matter which file is read. Any file read triggers LSP → freeze.
Trigger Condition
The freeze is triggered when OpenCode internally reads a file (e.g., via its Read tool or any file-reading command) and LSP automatically analyzes the content. This is NOT the same as "opening a file manually in the editor" — it happens specifically when Read operations occur.
Regression
- ✅ Version 1.14.36: LSP works correctly. No freeze.
- ❌ Version 1.15.3: LSP causes freeze.
The bug was introduced somewhere between 1.14.36 and 1.15.3.
How to Reproduce
- Install [email protected]:
npm install -g [email protected] - Enable LSP in
opencode.jsonwith at least one LSP server (e.g., marksman):"lsp": { "marksman": { "command": ["marksman", "server"], "extensions": [".md"] } }
- Restart OpenCode
- Use a tool that reads a file (e.g.,
Readoperation on any file matching configured extensions) - Observe: OpenCode freezes immediately
Workaround
- Downgrade to
npm install -g [email protected]— LSP works correctly - Or keep LSP disabled (
"lsp": falsein opencode.json)
Additional Notes
- The
opencode-windows-x64binary platform package is version-locked to the npm package version - Binary version string reports 1.3.13 internally (built with Bun runtime)
- Exe size: ~158MB
- No error logs are produced during the freeze — the app becomes completely unresponsive
Activity
github-actions commentedon May 16, 2026
This issue might be a duplicate of existing issues. Please check:
service=lsp file=... touching filebefore the hang, which closely matches the freeze-on-LSP-file-read behavior described here (different OS/version but same symptom area)papau5164 commentedon May 16, 2026
Update: Bisection Complete
After systematic version testing, the exact regression point has been identified:
Conclusion: The LSP freeze bug was introduced in version 1.15.1.
The trigger is: when OpenCode performs an internal file read operation (via built-in Read tool) with LSP enabled, the app freezes immediately and completely. This happens with any LSP server (tested with marksman alone), confirming it is an issue in OpenCode'"'"'s LSP client implementation, not in any specific language server.
Cross-reference: the
opencode-windows-x64binary is version-locked to the npm package version (1.15.1 = [email protected]).papau5164 commentedon May 16, 2026
This is likely not a duplicate of #22438. Here is why:
#22438 (claimed duplicate):
#27894 (this issue):
Bisection confirms the exact regression point:
The bug was introduced in v1.15.1. The common log signature (
touching filebefore hang) is coincidental — #22438 was a clangd-specific issue on Linux that predates this by many versions, while this is a cross-LSP client regression on Windows introduced in 1.15.1.Given the clear regression boundary (1.15.0 → 1.15.1), the diff between those two versions should reveal the problematic change in the LSP client code.
github-actions commentedon Jul 16, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.