opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Cannot use opencode in private network

Open lzy19990121-tech opened this issue 10 months ago • 3 comments

Question

When i use opencode in private network, { "name": "UnknownError", "data": { "message": "Error: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch()" } }

opencode is requiring modle list from https://models.dev/, which is not reachable in praivate network. Is there any way to solve this problem?

lzy19990121-tech avatar Jan 16 '26 07:01 lzy19990121-tech

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

  • #8814: [FEATURE]: Run opencode in private net - Same socket connection error and private network limitation
  • #8580: linux 启动报错 The socket connection was closed unexpectedly - Exact same socket connection error
  • #4284: socket connection error with ProxyChains - Socket connection error in restricted network environments
  • #7313: Does OpenCode Require Internet APIs? - Directly addresses the models.dev dependency issue
  • #6743: Google models list outdated in TUI - Details the models.dev hardcoded dependency problem

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Jan 16 '26 07:01 github-actions[bot]

If you’re on a private network, I’d use OpenCode Sentinel — it cuts all network access except to your LLM, so it works flawlessly in network-restricted environments 👍👍

Repo: https://github.com/oneoflzx/opencode-sentinel

OneOfLzx avatar Jan 22 '26 02:01 OneOfLzx

To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

github-actions[bot] avatar Mar 28 '26 03:03 github-actions[bot]