Skip to content

[Bug] LSP freezes and diagnostics timeout too short (3s) for heavy language servers #13326

@ojh102

Description

@ojh102

Description

Multiple users experiencing LSP-related freezes and timeouts across different scenarios:

Root Cause Analysis:

  1. Blocking initialization: getClients() was synchronous → blocked UI thread when LSP servers were slow to start
  2. Insufficient timeout defaults: Diagnostics timeout was hardcoded at 3s → too short for heavy linters like ESLint and Kotlin LSP
  3. No user escape hatch: No way for users to configure timeouts for their specific environment

Related PRs:

PR Approach Status Overlap with #13306
#13306 Non-blocking init + configurable diagnostics timeout Open Primary comprehensive fix
#13281 Diagnostics timeout 3s→10s Open Absorbed into #13306
#6997 Configurable timeout Open Partially addressed by #13306 env var
#13287 Startup package-manager timeout guard Open Independent (different timeout)
#13299 UI freeze on large diffs Open Independent (rendering issue)

Resolution Path:

Addressed by PR #13306:

  • ✅ Non-blocking LSP initialization (getClients returns immediately)
  • ✅ Configurable diagnostics timeout (10s default, override via OPENCODE_EXPERIMENTAL_LSP_DIAGNOSTICS_TIMEOUT_MS)

Remaining work (separate concerns):

Plugins

No response

OpenCode version

dev (latest)

Steps to reproduce

  1. Open a project with a heavy LSP (e.g., Kotlin, ESLint with many plugins)
  2. Start OpenCode
  3. Observe: UI blocks during LSP initialization, and diagnostics timeout at 3s returning empty results for slow language servers

Screenshot and/or share link

No response

Operating System

Cross-platform (reported on macOS, Windows, Linux)

Terminal

Multiple terminals affected (not terminal-specific)

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.perfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions