anomalyco / anomalyco/opencode
LSP client cache is reused after transport EOF
Open
@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
- Start an LSP server through OpenCode.
- Close the server stdout/JSON-RPC transport without a clean shutdown.
- Request diagnostics or another LSP operation.
- Observe that the stale client is reused and the operation times out.
Operating System
Windows 11 / Linux
Terminal
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.