cli: opencode run hangs indefinitely with local Ollama model
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nodejs, ollama, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Start by reproducing with opencode debug config to confirm the resolved default model, then run opencode run "Reply with exactly: LOCAL_OK" with a short timeout and check whether the request ever reaches http://127.0.0.1:11434/v1. The report leaves two suspects: the @ai-sdk/openai-compatible provider path and the sandbox block, since Docker Desktop's engine was not running during the hang while the remote-model control succeeded. Done means opencode run either prints the reply or exits with a clear timeout/connection error, ideally covered by a test that exercises a non-streaming local endpoint.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
opencode run with the default local Ollama model produces no output and never exits. The same CLI completes normally with an HTTP-compatible remote model, and Ollama's own API answers the same prompt in seconds.
Environment
- opencode version: 1.18.31 (
opencode --version; executable resolved through%APPDATA%\npm\opencode.ps1). OpenCode Desktop 2.3.2 is also installed but its CLI is not the one onPATH. - OS: Microsoft Windows NT 10.0.26300.0 (Windows 11 x64).
veris unavailable in PowerShell, so[Environment]::OSVersion.VersionStringwas used. - Terminal:
TERM=xterm-256color;TERM_PROGRAM,COLORTERM, andWT_SESSIONunset. Command was launched from the OpenCode shell tool (non-interactive). - Shell:
%COMSPEC%=C:\WINDOWS\system32\cmd.exe; OpenCode config sets"shell": "powershell"for its own shell tool. - Install/channel: npm global install, release channel (
C:\Users\<user>\AppData\Roaming\npm\opencode.ps1). - Active plugins: None found. No
pluginskey in~/.config/opencode/opencode.jsonoropencode.jsonc; no.opencode/plugin,.opencode/plugins,plugin, orpluginsdirectories under the global config directory.
Reproduction
- Install Ollama 0.40.16 and pull
qwen2.5-coder:7b(4.7 GB). Runollama servewithOLLAMA_HOST=127.0.0.1:11434; confirmGET http://127.0.0.1:11434/api/tagsreturns 200. - In the global config, the resolved default model is
ollama/qwen2.5-coder:7b(opencode debug configconfirms this). - Run
opencode run "Reply with exactly: LOCAL_OK"from any directory. - Wait several minutes. No output is produced and the prompt never returns.
- Control A: direct
POST http://127.0.0.1:11434/api/generatewith{"model":"qwen2.5-coder:7b","prompt":"Say OK","stream":false,"options":{"num_predict":8}}returns HTTP 200, body{"response":"OK"}, in about 19 seconds. - Control B:
opencode run -m freellmapi/nemotron-3-ultra-550b "Reply with exactly: SAFE_OK"printsSAFE_OKand exits normally.
Expected Behavior
opencode run should print the model's reply and exit, or surface a clear timeout/connection error if the model cannot be reached.
Actual Behavior
The process stayed alive for about 8 minutes with no stdout and no error. Get-Process showed the opencode.exe process alive with Responding = True and roughly 22 seconds of cumulative CPU time. The parent shell also stayed alive with no output because the pipeline buffers until the child exits. Both were terminated manually; the shell reported exit code 4294967295.
Additional Context
- Frequency: observed once; not re-run after restarting Ollama.
- Ollama was listening only on
127.0.0.1:11434with an inbound firewall block, so this is not a network reachability problem. - Relevant global config (no credentials shown):
"model": "ollama/qwen2.5-coder:7b",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": { "baseURL": "http://127.0.0.1:11434/v1" },
"models": {
"qwen2.5-coder:7b": { "name": "Qwen2.5 Coder 7B" }
}
}
},
"sandbox": {
"enabled": true,
"image": "langchain/langgraph-sandbox:latest",
"resources": { "cpu": 2, "memory": "4GiB" }
}
- Docker Desktop's engine was not running during the failing test (it was started afterwards for an unrelated container audit). If sandbox startup is involved in this hang, that is worth checking; the remote-model control succeeded under the same condition.
- No custom plugins or provider overrides affect this model beyond the config above.
- Ngôn ngữ chính
- TypeScript
- Star
- 227k
- Fork
- 30.7k
- Merge trung bình
- 3 giờ 57 phút
- Pull request đã merge (30 ngày)
- 484
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
[Site] Active section detection should respect scroll-margin-topCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea/web reproduced type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#65384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/cli type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#65379 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Shell tool: no upper bound on the timeout a model can ask for, so one call can hold a turn for hoursĐang mởarea/core platform/linux type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anomalyco/opencode#65254 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
inference/go type/feature
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#65148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/providers type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#64845 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởcatalog provider provider-compatibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
lidge-jun/opencodex#9037 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Project submission: xmcp DocsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
slavakurilyak/awesome-ai-agents#1005 ·
-
kind/bug triage/unresolved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:S P3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightscout/nocturne#3735 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
wpilibsuite/systemcore-blocks-interface#641 ·
Maintainer thường phản hồi trong vòng 2 ngày