anomalyco / anomalyco/opencode

LSP client cache is reused after transport EOF

Open
#44,855 0 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 25, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

An LSP server can close stdout or otherwise lose its JSON-RPC transport while its child process remains alive. OpenCode keeps the cached client for the same workspace and server, reports it as connected, and reuses it for later requests. Diagnostics and other requests then wait until their request timeout instead of failing fast.

Expected behavior

Detect transport failure, fail pending operations promptly, and remove the dead client from the cache so the next request starts a fresh LSP process.

Steps to reproduce
  1. Start an LSP server through OpenCode.
  2. Close the server stdout/JSON-RPC transport without a clean shutdown.
  3. Request diagnostics or another LSP operation.
  4. Observe that the stale client is reused and the operation times out.
Operating System

Windows 11 / Linux

Terminal

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.