Skip to content

Comments

fix(client): add request timeout to get_path() to prevent hanging on …#183

Open
zeekhuge wants to merge 1 commit intonickjvandyke:mainfrom
zeekhuge:main
Open

fix(client): add request timeout to get_path() to prevent hanging on …#183
zeekhuge wants to merge 1 commit intonickjvandyke:mainfrom
zeekhuge:main

Conversation

@zeekhuge
Copy link

@zeekhuge zeekhuge commented Feb 22, 2026

Description

This PR addresses an issue where the Neovim plugin becomes unresponsive when multiple opencode --port processes are running and one or more are stopped/unresponsive.

Problem

When I would open quite a few opencode instances (using opencode --port), some of the Nvim instance would become unresponsive to the Ctrl-a command.

On further investigation, I found that: the plugin discovers OpenCode servers by querying each server's /path endpoint. The curl command uses --connect-timeout 1, which only limits TCP connection time. If a process is stopped (e.g., via Ctrl+Z), the TCP socket still accepts connections but never responds, causing curl to hang indefinitely.

The current solution I use is kill $(pidof opencode) and then restart all of them. This works, but is a super productivity kill.
This PR is to bring in better support for the same.

Solution

Add a --max-time to the curl commands for the /path query.

@zeekhuge
Copy link
Author

Hi @nickjvandyke,
Looking forward to your feedback on this.

PS: Thank you for your amazing work on this plugin. I absolutely love using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant