[FEATURE]: Allow configurable timeouts to be set on LSPs #4520

Open
opened 2026-02-16 17:44:28 -05:00 by yindo · 2 comments
Owner

Originally created by @tjg184 on GitHub (Jan 9, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Some LSPs take longer to initialize. Currently, opencode has a default of 45 seconds, which is generally long enough, but not for all projects.

As an example, projects that have a high number of dependencies that need to be downloaded may take longer than the default timeout. I've seen this as an example with the kotlin-ls LSP.

This is the suggestion to either allow the global timeout to be configured beyond the 45 seconds or allow a specific LSP to be configured to override the default. Alternatively, we could just bump the 45 seconds to a higher value, but I suspect this will be an ongoing problem.

If we decide on the per-server timeout, I think it makes sense to allow an override on a built-in LSP server as well as a custom server.

I started a PR here to see what it might look like, specifically for the first case. https://github.com/anomalyco/opencode/pull/6997

Overriding a specific LSP:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["STYLE_GUIDE.md"],
  "provider": {
    "opencode": {
      "options": {},
    },
  },
  "lsp": {
    "kotlin-ls": {
      "timeout": 120000
    },
  },
}

Overriding the default LSP timeout:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["STYLE_GUIDE.md"],
  "provider": {
    "opencode": {
      "options": {},
    },
  },
  "lsp": {
      "timeout": 120000
  },
}
Originally created by @tjg184 on GitHub (Jan 9, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Some LSPs take longer to initialize. Currently, opencode has a default of 45 seconds, which is generally long enough, but not for all projects. As an example, projects that have a high number of dependencies that need to be downloaded may take longer than the default timeout. I've seen this as an example with the `kotlin-ls` LSP. This is the suggestion to either allow the global timeout to be configured beyond the 45 seconds or allow a specific LSP to be configured to override the default. Alternatively, we could just bump the 45 seconds to a higher value, but I suspect this will be an ongoing problem. If we decide on the per-server timeout, I think it makes sense to allow an override on a built-in LSP server as well as a custom server. I started a PR here to see what it might look like, specifically for the first case. https://github.com/anomalyco/opencode/pull/6997 Overriding a specific LSP: ``` { "$schema": "https://opencode.ai/config.json", "instructions": ["STYLE_GUIDE.md"], "provider": { "opencode": { "options": {}, }, }, "lsp": { "kotlin-ls": { "timeout": 120000 }, }, } ``` Overriding the default LSP timeout: ``` { "$schema": "https://opencode.ai/config.json", "instructions": ["STYLE_GUIDE.md"], "provider": { "opencode": { "options": {}, }, }, "lsp": { "timeout": 120000 }, } ```
yindo added the discussion label 2026-02-16 17:44:28 -05:00
Author
Owner

@yangmiao7 commented on GitHub (Jan 26, 2026):

I am encountering a similar issue with Vue LSP (Volar) timing out due to heavy initialization, which seems related to the hardcoded timeout limits. The situation is exacerbated by a version mismatch in my project (Vue 3.4+ with legacy vue-tsc 0.39), but a configurable timeout would greatly help in diagnosing and mitigating such environment-specific slow starts. +1 for this feature request.

@yangmiao7 commented on GitHub (Jan 26, 2026): I am encountering a similar issue with Vue LSP (Volar) timing out due to heavy initialization, which seems related to the hardcoded timeout limits. The situation is exacerbated by a version mismatch in my project (Vue 3.4+ with legacy vue-tsc 0.39), but a configurable timeout would greatly help in diagnosing and mitigating such environment-specific slow starts. +1 for this feature request.
Author
Owner

@tjg184 commented on GitHub (Jan 27, 2026):

I am encountering a similar issue with Vue LSP (Volar) timing out due to heavy initialization, which seems related to the hardcoded timeout limits. The situation is exacerbated by a version mismatch in my project (Vue 3.4+ with legacy vue-tsc 0.39), but a configurable timeout would greatly help in diagnosing and mitigating such environment-specific slow starts. +1 for this feature request.

I have linked PR if you want to attempt to test. It fixes our issue.

@tjg184 commented on GitHub (Jan 27, 2026): > I am encountering a similar issue with Vue LSP (Volar) timing out due to heavy initialization, which seems related to the hardcoded timeout limits. The situation is exacerbated by a version mismatch in my project (Vue 3.4+ with legacy vue-tsc 0.39), but a configurable timeout would greatly help in diagnosing and mitigating such environment-specific slow starts. +1 for this feature request. I have linked PR if you want to attempt to test. It fixes our issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4520