Skip to content

LSP causes desktop app to freeze/hang on file read (regression in 1.15.x) #27894

Closed as not planned

Description

@papau5164

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:

  1. Not npm/environment related:

    • npm_config_user_agent environment 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
  2. Not LSP server specific:

    • Tested with marksman only (simplest, standalone binary) — still freezes
    • All LSP servers work fine individually
  3. Not plugin related:

    • Tested with only oh-my-openagent plugin active (removed all others) — still freezes
  4. 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

  1. Install [email protected]: npm install -g [email protected]
  2. Enable LSP in opencode.json with at least one LSP server (e.g., marksman):
    "lsp": {
      "marksman": {
        "command": ["marksman", "server"],
        "extensions": [".md"]
      }
    }
  3. Restart OpenCode
  4. Use a tool that reads a file (e.g., Read operation on any file matching configured extensions)
  5. Observe: OpenCode freezes immediately

Workaround

  • Downgrade to npm install -g [email protected] — LSP works correctly
  • Or keep LSP disabled ("lsp": false in opencode.json)

Additional Notes

  • The opencode-windows-x64 binary 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

  1. github-actions commented on May 16, 2026

    @github-actions
    Contributor

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

    • opencode hangs after editing file, no further logs #22438: opencode hangs after editing file, no further logs — the last log line shows service=lsp file=... touching file before the hang, which closely matches the freeze-on-LSP-file-read behavior described here (different OS/version but same symptom area)
  2. papau5164 commented on May 16, 2026

    @papau5164
    Author

    Update: Bisection Complete

    After systematic version testing, the exact regression point has been identified:

    Version LSP Status
    1.14.36 ✅ Works
    1.15.0 ✅ Works
    1.15.1 ❌ Freezes ❮ first broken
    1.15.2 ❌ Freezes
    1.15.3 ❌ Freezes

    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-x64 binary is version-locked to the npm package version (1.15.1 = [email protected]).

  3. papau5164 commented on May 16, 2026

    @papau5164
    Author

    This is likely not a duplicate of #22438. Here is why:

    #22438 (claimed duplicate):

    • Ubuntu 24.04, clangd, C++ files
    • opencode v1.4.3
    • Trigger: after editing a file
    • Resolution: manually installing clangd (instead of auto-download) fixed it → suggests it was a clangd-specific issue

    #27894 (this issue):

    • Windows, tested with 6 different LSP servers (marksman, docker-langserver, json/css/html languageservers, basedpyright)
    • opencode v1.15.1+ (confirmed regression from v1.15.0)
    • Trigger: internal file Read operation (not edit)
    • All 6 LSP servers work correctly when spawned independently (<300ms response)
    • The freeze happens with ANY LSP server configured → points to a bug in opencode'"'"'s LSP client implementation, not in any language server

    Bisection confirms the exact regression point:

    Version Status
    1.14.36 ✅ Works
    1.15.0 ✅ Works
    1.15.1 ❌ First broken
    1.15.2 ❌ Broken
    1.15.3 ❌ Broken

    The bug was introduced in v1.15.1. The common log signature (touching file before 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.

  4. github-actions commented on Jul 16, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions