bug: sometimes clangd lsp hangs #2375

Closed
opened 2026-02-16 17:35:23 -05:00 by yindo · 9 comments
Owner

Originally created by @rekram1-node on GitHub (Oct 31, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Some users get stuck in a working state because the lsp just hangs, we need to figure out why and fix

Assigning to myself to track but help is wanted if anyone wants to take a stap at fixing this

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @rekram1-node on GitHub (Oct 31, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Some users get stuck in a working state because the lsp just hangs, we need to figure out why and fix Assigning to myself to track but help is wanted if anyone wants to take a stap at fixing this ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the help-wantedbug labels 2026-02-16 17:35:23 -05:00
yindo closed this issue 2026-02-16 17:35:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2514: "Can't modify cpp files. Stuck at 'Working...'. Can't interrupt." - Shows similar behavior where OpenCode gets stuck during clangd operations, specifically when working with C++ files and clangd is downloading/initializing. The logs show "downloading clangd from GitHub releases" and then the system hangs indefinitely.

  • #2438: "Seems to freeze on 'working...' with no changes" - Reports freezing with "Working..." status that cannot be interrupted with ESC, similar symptoms of LSP hanging.

  • #731: "Critical Stability Issues: App Freezing & Hanging Analysis" - Comprehensive analysis of various hanging issues, including LSP server failures that cause indefinite hangs during startup/operation with no timeout or health checks for LSP server connections.

Feel free to ignore if none of these address your specific case, but the clangd hanging issue (#2514) seems very similar to what you're experiencing.

@github-actions[bot] commented on GitHub (Oct 31, 2025): This issue might be a duplicate of existing issues. Please check: - #2514: "Can't modify cpp files. Stuck at 'Working...'. Can't interrupt." - Shows similar behavior where OpenCode gets stuck during clangd operations, specifically when working with C++ files and clangd is downloading/initializing. The logs show "downloading clangd from GitHub releases" and then the system hangs indefinitely. - #2438: "Seems to freeze on 'working...' with no changes" - Reports freezing with "Working..." status that cannot be interrupted with ESC, similar symptoms of LSP hanging. - #731: "Critical Stability Issues: App Freezing & Hanging Analysis" - Comprehensive analysis of various hanging issues, including LSP server failures that cause indefinite hangs during startup/operation with no timeout or health checks for LSP server connections. Feel free to ignore if none of these address your specific case, but the clangd hanging issue (#2514) seems very similar to what you're experiencing.
Author
Owner

@d33tah commented on GitHub (Nov 7, 2025):

Do we already have enough diagnostic information? One thing I noticed in debug mode was that this repeats every session:

INFO  2025-11-07T14:20:06 +9ms service=lsp.server downloading clangd from GitHub releases

Is it not cached? Perhaps we could use the stdout/stderr of the LSP copied in debug log?

@d33tah commented on GitHub (Nov 7, 2025): Do we already have enough diagnostic information? One thing I noticed in debug mode was that this repeats every session: ``` INFO 2025-11-07T14:20:06 +9ms service=lsp.server downloading clangd from GitHub releases ``` Is it not cached? Perhaps we could use the stdout/stderr of the LSP copied in debug log?
Author
Owner

@rekram1-node commented on GitHub (Nov 7, 2025):

@d33tah it must be failing to download for u what setup do u have? Part of that PR is fixing an issue where it could keep trying throughout a session

@rekram1-node commented on GitHub (Nov 7, 2025): @d33tah it must be failing to download for u what setup do u have? Part of that PR is fixing an issue where it could keep trying throughout a session
Author
Owner

@d33tah commented on GitHub (Nov 7, 2025):

@rekram1-node

user@claude-code-experiment:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description:    Debian GNU/Linux 13 (trixie) Release:        13 Codename:       trixie
user@claude-code-experiment:~$ uname -a
Linux claude-code-experiment 6.12.48+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux
Filesystem                                      Size  Used Avail Use% Mounted on
udev                                            8.2G     0  8.2G   0% /dev
/dev/sda1                                       161G  132G   24G  86% /
/dev/sda15                                      252M  149k  252M   1% /boot/efi
user@claude-code-experiment:~$ free ; nproc ; head /proc/cpuinfo
               total        used        free      shared  buff/cache   available
Mem:        15995736     9702916     3718568     5313896     8644536     6292820
Swap:              0           0           0
8
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel Xeon Processor (Skylake, IBRS, no TSX)
stepping        : 4
microcode       : 0x1
cpu MHz         : 2294.614
cache size      : 16384 KB
physical id     : 0
user@claude-code-experiment:~$ inxi -F
System:
  Host: claude-code-experiment Kernel: 6.12.48+deb13-cloud-amd64 arch: x86_64 bits: 64
  Console: pty pts/8 Distro: Debian GNU/Linux 13 (trixie)
Machine:
  Type: Kvm System: Hetzner product: vServer v: 20171111 serial: <superuser required>
  Mobo: KVM model: Standard PC (Q35 + ICH9, 2009) v: pc-q35-6.2 serial: <superuser required>
    BIOS: Hetzner v: 20171111 date: 11/11/2017
CPU:
  Info: 8-core model: Intel Xeon (Skylake IBRS no TSX) bits: 64 type: MCP cache: L2: 32 MiB
  Speed (MHz): avg: 2295 min/max: N/A cores: 1: 2295 2: 2295 3: 2295 4: 2295 5: 2295 6: 2295
    7: 2295 8: 2295
Graphics:
  Device-1: Red Hat Virtio 1.0 GPU driver: virtio-pci v: 1
  Display: unspecified server: N/A driver: N/A tty: 155x57
  API: N/A Message: No API data available in console. Headless machine?
  Info: Tools: No graphics tools found.
Audio:
  Message: No device data found.
Network:
  Device-1: Red Hat Virtio 1.0 network driver: virtio-pci
  IF-ID-1: br-61715bbb141a state: up speed: 10000 Mbps duplex: unknown mac: 02:42:67:cb:d5:31
  IF-ID-2: br-6d433aea8ae0 state: up speed: 10000 Mbps duplex: unknown mac: 02:42:c0:47:13:cb
  IF-ID-3: br-b3a8686cf35e state: down mac: 02:42:40:07:35:a5
  IF-ID-4: docker0 state: up speed: 10000 Mbps duplex: unknown mac: 02:42:31:6a:63:c2
  IF-ID-5: eth0 state: up speed: -1 duplex: unknown mac: 92:00:06:8c:ce:17
  IF-ID-6: veth3ba3e77 state: up speed: 10000 Mbps duplex: full mac: 0a:32:ba:fd:a4:ee
  IF-ID-7: veth7edb024 state: up speed: 10000 Mbps duplex: full mac: b2:f0:42:e3:14:99
  IF-ID-8: vethaeb2b47 state: up speed: 10000 Mbps duplex: full mac: 52:64:4e:47:5a:54
  IF-ID-9: vetheee881e state: up speed: 10000 Mbps duplex: full mac: 4a:3e:df:e3:3f:05
Drives:
  Local Storage: total: 152.59 GiB used: 122.25 GiB (80.1%)
  ID-1: /dev/sda vendor: QEMU model: HARDDISK size: 152.59 GiB
Partition:
  ID-1: / size: 149.92 GiB used: 122.25 GiB (81.5%) fs: ext4 dev: /dev/sda1
  ID-2: /boot/efi size: 240.2 MiB used: 146 KiB (0.1%) fs: vfat dev: /dev/sda15
Swap:
  Alert: No swap data was found.
Sensors:
  Src: lm-sensors Missing: Required tool sensors not installed. Check --recommends
Info:
  Memory: total: 15.62 GiB available: 15.25 GiB used: 9.25 GiB (60.7%)
  Processes: 245 Uptime: 8d 1h 53m Init: systemd Shell: Bash inxi: 3.3.38

Is there anything else you'd like to know about my setup?

@d33tah commented on GitHub (Nov 7, 2025): @rekram1-node ``` user@claude-code-experiment:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 13 (trixie) Release: 13 Codename: trixie ``` ``` user@claude-code-experiment:~$ uname -a Linux claude-code-experiment 6.12.48+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux ``` ```user@claude-code-experiment:~$ df -H | grep -v tmpfs Filesystem Size Used Avail Use% Mounted on udev 8.2G 0 8.2G 0% /dev /dev/sda1 161G 132G 24G 86% / /dev/sda15 252M 149k 252M 1% /boot/efi ``` ``` user@claude-code-experiment:~$ free ; nproc ; head /proc/cpuinfo total used free shared buff/cache available Mem: 15995736 9702916 3718568 5313896 8644536 6292820 Swap: 0 0 0 8 processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 85 model name : Intel Xeon Processor (Skylake, IBRS, no TSX) stepping : 4 microcode : 0x1 cpu MHz : 2294.614 cache size : 16384 KB physical id : 0 ``` ``` user@claude-code-experiment:~$ inxi -F System: Host: claude-code-experiment Kernel: 6.12.48+deb13-cloud-amd64 arch: x86_64 bits: 64 Console: pty pts/8 Distro: Debian GNU/Linux 13 (trixie) Machine: Type: Kvm System: Hetzner product: vServer v: 20171111 serial: <superuser required> Mobo: KVM model: Standard PC (Q35 + ICH9, 2009) v: pc-q35-6.2 serial: <superuser required> BIOS: Hetzner v: 20171111 date: 11/11/2017 CPU: Info: 8-core model: Intel Xeon (Skylake IBRS no TSX) bits: 64 type: MCP cache: L2: 32 MiB Speed (MHz): avg: 2295 min/max: N/A cores: 1: 2295 2: 2295 3: 2295 4: 2295 5: 2295 6: 2295 7: 2295 8: 2295 Graphics: Device-1: Red Hat Virtio 1.0 GPU driver: virtio-pci v: 1 Display: unspecified server: N/A driver: N/A tty: 155x57 API: N/A Message: No API data available in console. Headless machine? Info: Tools: No graphics tools found. Audio: Message: No device data found. Network: Device-1: Red Hat Virtio 1.0 network driver: virtio-pci IF-ID-1: br-61715bbb141a state: up speed: 10000 Mbps duplex: unknown mac: 02:42:67:cb:d5:31 IF-ID-2: br-6d433aea8ae0 state: up speed: 10000 Mbps duplex: unknown mac: 02:42:c0:47:13:cb IF-ID-3: br-b3a8686cf35e state: down mac: 02:42:40:07:35:a5 IF-ID-4: docker0 state: up speed: 10000 Mbps duplex: unknown mac: 02:42:31:6a:63:c2 IF-ID-5: eth0 state: up speed: -1 duplex: unknown mac: 92:00:06:8c:ce:17 IF-ID-6: veth3ba3e77 state: up speed: 10000 Mbps duplex: full mac: 0a:32:ba:fd:a4:ee IF-ID-7: veth7edb024 state: up speed: 10000 Mbps duplex: full mac: b2:f0:42:e3:14:99 IF-ID-8: vethaeb2b47 state: up speed: 10000 Mbps duplex: full mac: 52:64:4e:47:5a:54 IF-ID-9: vetheee881e state: up speed: 10000 Mbps duplex: full mac: 4a:3e:df:e3:3f:05 Drives: Local Storage: total: 152.59 GiB used: 122.25 GiB (80.1%) ID-1: /dev/sda vendor: QEMU model: HARDDISK size: 152.59 GiB Partition: ID-1: / size: 149.92 GiB used: 122.25 GiB (81.5%) fs: ext4 dev: /dev/sda1 ID-2: /boot/efi size: 240.2 MiB used: 146 KiB (0.1%) fs: vfat dev: /dev/sda15 Swap: Alert: No swap data was found. Sensors: Src: lm-sensors Missing: Required tool sensors not installed. Check --recommends Info: Memory: total: 15.62 GiB available: 15.25 GiB used: 9.25 GiB (60.7%) Processes: 245 Uptime: 8d 1h 53m Init: systemd Shell: Bash inxi: 3.3.38 ``` Is there anything else you'd like to know about my setup?
Author
Owner

@rekram1-node commented on GitHub (Nov 7, 2025):

@d33tah do u have unzip installed

@rekram1-node commented on GitHub (Nov 7, 2025): @d33tah do u have `unzip` installed
Author
Owner

@rekram1-node commented on GitHub (Nov 7, 2025):

@d33tah i redacted ur message for ya thanks!

@rekram1-node commented on GitHub (Nov 7, 2025): @d33tah i redacted ur message for ya thanks!
Author
Owner

@zhonguoq commented on GitHub (Nov 11, 2025):

I frequently meet this issue since v0.4.16. I working on c/c++ project.

@zhonguoq commented on GitHub (Nov 11, 2025): I frequently meet this issue since v0.4.16. I working on c/c++ project.
Author
Owner

@rekram1-node commented on GitHub (Nov 12, 2025):

@zhonguoq it will be fixed in the next release

@rekram1-node commented on GitHub (Nov 12, 2025): @zhonguoq it will be fixed in the next release
Author
Owner

@zhonguoq commented on GitHub (Nov 12, 2025):

Thanks!

@zhonguoq commented on GitHub (Nov 12, 2025): Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2375