ESLint LSP server initializes but diagnostics timeout with empty result #9146

Open
opened 2026-02-16 18:11:44 -05:00 by yindo · 1 comment
Owner

Originally created by @mayurj747 on GitHub (Feb 12, 2026).

Originally assigned to: @thdxr on GitHub.

Description

ESLint LSP diagnostics are not being surfaced to the LLM during a session. According to the LSP docs, the built-in ESLint LSP server should automatically activate when eslint is a project dependency and .js files are present. However, when the LLM reads a file with known ESLint errors, no diagnostic information is included in the tool results.

Reproduction

  1. Clone https://github.com/mayurj747/lint-demo
  2. Run npm install
  3. Start an OpenCode session and ask the LLM to read index.js
  4. Observe that no ESLint diagnostics are attached to the file read output

The file has 5 known ESLint errors (no-unused-vars, no-constant-condition, eqeqeq, no-undef) which are correctly reported when running npx eslint index.js directly.

Debug diagnostics

Running the debug command with --log-level DEBUG shows the ESLint LSP server spawns and initializes successfully, sends textDocument/didOpen, but the diagnostics subscription times out after ~3 seconds and returns an empty {}:

❯ opencode debug lsp diagnostics index.js --print-logs --log-level DEBUG
INFO  2026-02-12T06:23:21 +361ms service=default version=1.1.57 args=["debug","lsp","diagnostics","index.js","--print-logs","--log-level","DEBUG"] opencode
INFO  2026-02-12T06:23:21 +1ms service=default directory=/Users/mbency/projects/lint-demo creating instance
INFO  2026-02-12T06:23:21 +0ms service=project directory=/Users/mbency/projects/lint-demo fromDirectory
INFO  2026-02-12T06:23:21 +65ms service=default directory=/Users/mbency/projects/lint-demo bootstrapping
INFO  2026-02-12T06:23:21 +3ms service=config path=/Users/mbency/.config/opencode/config.json loading
INFO  2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/.config/opencode/opencode.json loading
INFO  2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/.config/opencode/opencode.jsonc loading
INFO  2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/projects/lint-demo/opencode.json loading
INFO  2026-02-12T06:23:21 +6ms service=plugin name=CodexAuthPlugin loading internal plugin
INFO  2026-02-12T06:23:21 +0ms service=plugin name=CopilotAuthPlugin loading internal plugin
INFO  2026-02-12T06:23:21 +0ms service=plugin name=gitlabAuthPlugin loading internal plugin
INFO  2026-02-12T06:23:21 +1ms service=plugin path=opencode-anthropic-auth@0.0.13 loading plugin
INFO  2026-02-12T06:23:21 +37ms service=bus type=* subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=session.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=message.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=message.part.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=session.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=message.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=message.part.updated subscribing
INFO  2026-02-12T06:23:21 +0ms service=bus type=session.diff subscribing
INFO  2026-02-12T06:23:21 +0ms service=format init
INFO  2026-02-12T06:23:21 +0ms service=bus type=file.edited subscribing
INFO  2026-02-12T06:23:21 +0ms service=lsp serverIds=deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, fsharp, sourcekit-lsp, rust, clangd, svelte, astro, jdtls, kotlin-ls, yaml-ls, lua-ls, php intelephense, prisma, dart, ocaml-lsp, bash, terraform, texlab, dockerfile, gleam, clojure-lsp, nixd, tinymist, haskell-language-server enabled LSP servers
INFO  2026-02-12T06:23:21 +1ms service=file.watcher init
INFO  2026-02-12T06:23:21 +1ms service=scheduler id=snapshot.cleanup run
INFO  2026-02-12T06:23:21 +0ms service=scheduler id=tool.truncation.cleanup run
INFO  2026-02-12T06:23:21 +0ms service=bus type=command.executed subscribing
INFO  2026-02-12T06:23:21 +1ms service=file.watcher platform=darwin backend=fs-events watcher backend
INFO  2026-02-12T06:23:21 +173ms service=lsp file=index.js touching file
INFO  2026-02-12T06:23:21 +8ms service=vcs branch=main initialized
INFO  2026-02-12T06:23:21 +0ms service=bus type=file.watcher.updated subscribing
INFO  2026-02-12T06:23:21 +4ms service=lsp.server typescript server
INFO  2026-02-12T06:23:21 +3ms service=lsp.server spawning eslint server
INFO  2026-02-12T06:23:21 +3ms service=lsp serverID=eslint spawned lsp server
INFO  2026-02-12T06:23:21 +0ms service=lsp.client serverID=eslint starting client
INFO  2026-02-12T06:23:21 +4ms service=lsp.client serverID=eslint sending initialize
INFO  2026-02-12T06:23:22 +79ms service=lsp.client serverID=eslint initialized
INFO  2026-02-12T06:23:22 +0ms service=bus type=lsp.updated publishing
INFO  2026-02-12T06:23:22 +1ms service=lsp.server oxlint not found, please install oxlint
INFO  2026-02-12T06:23:22 +1ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js waiting for diagnostics
INFO  2026-02-12T06:23:22 +0ms service=bus type=lsp.client.diagnostics subscribing
INFO  2026-02-12T06:23:22 +0ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js workspace/didChangeWatchedFiles
INFO  2026-02-12T06:23:22 +0ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js textDocument/didOpen
INFO  2026-02-12T06:23:22 +10ms service=snapshot prune=7.days cleanup
INFO  2026-02-12T06:23:25 +2992ms service=bus type=lsp.client.diagnostics unsubscribing
{}
INFO  2026-02-12T06:23:26 +1014ms service=default directory=/Users/mbency/projects/lint-demo disposing instance
INFO  2026-02-12T06:23:26 +0ms service=state key=/Users/mbency/projects/lint-demo waiting for state disposal to complete
INFO  2026-02-12T06:23:26 +1ms service=lsp.client serverID=eslint shutting down
INFO  2026-02-12T06:23:26 +1ms service=lsp.client serverID=eslint shutdown
INFO  2026-02-12T06:23:26 +0ms service=bus type=file.watcher.updated unsubscribing
INFO  2026-02-12T06:23:26 +1ms service=state key=/Users/mbency/projects/lint-demo state disposal completed

Notable observations:

  • The ESLint server does spawn and initialize successfully
  • textDocument/didOpen is sent for index.js
  • The client waits for diagnostics (waiting for diagnostics) but the lsp.client.diagnostics subscription unsubscribes after ~3 seconds with no diagnostics received
  • The debug command returns {} (empty)
  • OpenCode version: 1.1.57

Additional context

  • The project has eslint as a devDependency in package.json and an eslint.config.js flat config
  • Running ESLint manually via bash works correctly and reports all 5 errors
  • The LLM receives only raw file contents with no diagnostic annotations when using the Read tool

Expected behavior

ESLint LSP diagnostics should be available to the LLM when files are read, as described in the LSP documentation.

Originally created by @mayurj747 on GitHub (Feb 12, 2026). Originally assigned to: @thdxr on GitHub. ## Description ESLint LSP diagnostics are not being surfaced to the LLM during a session. According to the [LSP docs](https://opencode.ai/docs/lsp/), the built-in ESLint LSP server should automatically activate when `eslint` is a project dependency and `.js` files are present. However, when the LLM reads a file with known ESLint errors, no diagnostic information is included in the tool results. ## Reproduction 1. Clone https://github.com/mayurj747/lint-demo 2. Run `npm install` 3. Start an OpenCode session and ask the LLM to read `index.js` 4. Observe that no ESLint diagnostics are attached to the file read output The file has 5 known ESLint errors (`no-unused-vars`, `no-constant-condition`, `eqeqeq`, `no-undef`) which are correctly reported when running `npx eslint index.js` directly. ## Debug diagnostics Running the debug command with `--log-level DEBUG` shows the ESLint LSP server spawns and initializes successfully, sends `textDocument/didOpen`, but the diagnostics subscription times out after ~3 seconds and returns an empty `{}`: ``` ❯ opencode debug lsp diagnostics index.js --print-logs --log-level DEBUG INFO 2026-02-12T06:23:21 +361ms service=default version=1.1.57 args=["debug","lsp","diagnostics","index.js","--print-logs","--log-level","DEBUG"] opencode INFO 2026-02-12T06:23:21 +1ms service=default directory=/Users/mbency/projects/lint-demo creating instance INFO 2026-02-12T06:23:21 +0ms service=project directory=/Users/mbency/projects/lint-demo fromDirectory INFO 2026-02-12T06:23:21 +65ms service=default directory=/Users/mbency/projects/lint-demo bootstrapping INFO 2026-02-12T06:23:21 +3ms service=config path=/Users/mbency/.config/opencode/config.json loading INFO 2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/.config/opencode/opencode.json loading INFO 2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/.config/opencode/opencode.jsonc loading INFO 2026-02-12T06:23:21 +0ms service=config path=/Users/mbency/projects/lint-demo/opencode.json loading INFO 2026-02-12T06:23:21 +6ms service=plugin name=CodexAuthPlugin loading internal plugin INFO 2026-02-12T06:23:21 +0ms service=plugin name=CopilotAuthPlugin loading internal plugin INFO 2026-02-12T06:23:21 +0ms service=plugin name=gitlabAuthPlugin loading internal plugin INFO 2026-02-12T06:23:21 +1ms service=plugin path=opencode-anthropic-auth@0.0.13 loading plugin INFO 2026-02-12T06:23:21 +37ms service=bus type=* subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=session.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=message.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=message.part.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=session.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=message.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=message.part.updated subscribing INFO 2026-02-12T06:23:21 +0ms service=bus type=session.diff subscribing INFO 2026-02-12T06:23:21 +0ms service=format init INFO 2026-02-12T06:23:21 +0ms service=bus type=file.edited subscribing INFO 2026-02-12T06:23:21 +0ms service=lsp serverIds=deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, fsharp, sourcekit-lsp, rust, clangd, svelte, astro, jdtls, kotlin-ls, yaml-ls, lua-ls, php intelephense, prisma, dart, ocaml-lsp, bash, terraform, texlab, dockerfile, gleam, clojure-lsp, nixd, tinymist, haskell-language-server enabled LSP servers INFO 2026-02-12T06:23:21 +1ms service=file.watcher init INFO 2026-02-12T06:23:21 +1ms service=scheduler id=snapshot.cleanup run INFO 2026-02-12T06:23:21 +0ms service=scheduler id=tool.truncation.cleanup run INFO 2026-02-12T06:23:21 +0ms service=bus type=command.executed subscribing INFO 2026-02-12T06:23:21 +1ms service=file.watcher platform=darwin backend=fs-events watcher backend INFO 2026-02-12T06:23:21 +173ms service=lsp file=index.js touching file INFO 2026-02-12T06:23:21 +8ms service=vcs branch=main initialized INFO 2026-02-12T06:23:21 +0ms service=bus type=file.watcher.updated subscribing INFO 2026-02-12T06:23:21 +4ms service=lsp.server typescript server INFO 2026-02-12T06:23:21 +3ms service=lsp.server spawning eslint server INFO 2026-02-12T06:23:21 +3ms service=lsp serverID=eslint spawned lsp server INFO 2026-02-12T06:23:21 +0ms service=lsp.client serverID=eslint starting client INFO 2026-02-12T06:23:21 +4ms service=lsp.client serverID=eslint sending initialize INFO 2026-02-12T06:23:22 +79ms service=lsp.client serverID=eslint initialized INFO 2026-02-12T06:23:22 +0ms service=bus type=lsp.updated publishing INFO 2026-02-12T06:23:22 +1ms service=lsp.server oxlint not found, please install oxlint INFO 2026-02-12T06:23:22 +1ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js waiting for diagnostics INFO 2026-02-12T06:23:22 +0ms service=bus type=lsp.client.diagnostics subscribing INFO 2026-02-12T06:23:22 +0ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js workspace/didChangeWatchedFiles INFO 2026-02-12T06:23:22 +0ms service=lsp.client serverID=eslint path=/Users/mbency/projects/lint-demo/index.js textDocument/didOpen INFO 2026-02-12T06:23:22 +10ms service=snapshot prune=7.days cleanup INFO 2026-02-12T06:23:25 +2992ms service=bus type=lsp.client.diagnostics unsubscribing {} INFO 2026-02-12T06:23:26 +1014ms service=default directory=/Users/mbency/projects/lint-demo disposing instance INFO 2026-02-12T06:23:26 +0ms service=state key=/Users/mbency/projects/lint-demo waiting for state disposal to complete INFO 2026-02-12T06:23:26 +1ms service=lsp.client serverID=eslint shutting down INFO 2026-02-12T06:23:26 +1ms service=lsp.client serverID=eslint shutdown INFO 2026-02-12T06:23:26 +0ms service=bus type=file.watcher.updated unsubscribing INFO 2026-02-12T06:23:26 +1ms service=state key=/Users/mbency/projects/lint-demo state disposal completed ``` Notable observations: - The ESLint server **does** spawn and initialize successfully - `textDocument/didOpen` is sent for `index.js` - The client waits for diagnostics (`waiting for diagnostics`) but the `lsp.client.diagnostics` subscription unsubscribes after ~3 seconds with no diagnostics received - The debug command returns `{}` (empty) - OpenCode version: **1.1.57** ## Additional context - The project has `eslint` as a `devDependency` in `package.json` and an `eslint.config.js` flat config - Running ESLint manually via bash works correctly and reports all 5 errors - The LLM receives only raw file contents with no diagnostic annotations when using the Read tool ## Expected behavior ESLint LSP diagnostics should be available to the LLM when files are read, as described in the LSP documentation.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 12, 2026):

This issue may be related to #12288 (LSP diagnostics are skipped or delayed under multiple conditions), which documents systematic issues with LSP diagnostic processing. It's possible the ESLint diagnostics are being filtered out or delayed by the conditions described in that issue.

@github-actions[bot] commented on GitHub (Feb 12, 2026): This issue may be related to #12288 (LSP diagnostics are skipped or delayed under multiple conditions), which documents systematic issues with LSP diagnostic processing. It's possible the ESLint diagnostics are being filtered out or delayed by the conditions described in that issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9146