Cannot use opencode in private network #6437

Open
opened 2026-02-16 18:04:13 -05:00 by yindo · 2 comments
Owner

Originally created by @lzy19990121-tech on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

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?

Originally created by @lzy19990121-tech on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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?
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

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] commented on GitHub (Jan 16, 2026): 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.
Author
Owner

@OneOfLzx commented on GitHub (Jan 21, 2026):

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 commented on GitHub (Jan 21, 2026): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6437