Skip to content

Commit 83a18c5

Browse files
mdrclaude
andcommitted
DeepSeek runs: stdin from /dev/null, the cause of the OpenCode startup hangs (SW-1097; upstream anomalyco/opencode#59287)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013PT4qrwxYqrMiV3NNMwc3o
1 parent 811330f commit 83a18c5

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎CLAUDE.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ Use the cheapest model that can do the work well. Provisional (D2208, Matt,
7676
`docs/workflow.md`). GLM is the fallback. Run it with OpenCode's default
7777
permissions, without a sandbox (Matt, 2 Nov 2026): `opencode run
7878
--standalone --auto --agent build --model opencode-go/deepseek-v4.1-flash
79-
"<brief>"` in the clone, as a background job of the orchestrator's. The
79+
"<brief>" </dev/null` in the clone, as a background job of the
80+
orchestrator's. The `</dev/null` matters: with stdin an open pipe,
81+
OpenCode 2.1.x waits for it to close and never starts (SW-1097, upstream
82+
anomalyco/opencode#59287). The
8083
safety comes from the clone having no remote, the brief's rules, and the
8184
review.
8285
- **Neither model's "done" is taken on trust:** the orchestrator runs the

‎board/tickets.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,14 +3644,14 @@
36443644
{
36453645
"id": 1097,
36463646
"title": "OpenCode run hangs at startup, before any model request (2 of 4 starts on 2 Nov 2026, OpenCode 2.1.4): the run's server logs 'cli starting' and nothing more; when killed after 32 min it was in Project.resolve / FileSystem.resolve. The API answered a test prompt in 5 s; the same command in the same clone ran fine twice after. Suspects (unconfirmed): two servers starting at once (SW-1092's run was alive at the first hang), the long-lived 'opencode serve --service' sharing opencode.db, 2.1.4 (earlier runs were 2.1.1). Workaround: --print-logs and restart a run that logs nothing within 2 minutes (docs/workflow.md, D2217). Matt (D2217): bring this forward if it keeps happening; record each new hang here",
3647-
"status": "doing",
3647+
"status": "review",
36483648
"agent": "",
36493649
"where": "",
36503650
"labels": [
36513651
"tooling",
36523652
"bug"
36533653
],
3654-
"body": "\n\nHang 3, 23:17:46 (run a225c46a, SW-1102 in a new scratch clone scratch-sw-1102): same signature, server 92c3af4c logged 'cli starting' and nothing in 2 min. No other opencode run alive; 'opencode serve --service' (pid 48942, since ~17:36, ppid 1) was. Per D2217 the investigation is brought forward (started 23:21, Sonnet).\n",
3654+
"body": "\n\nHang 3, 23:17:46 (run a225c46a, SW-1102 in a new scratch clone scratch-sw-1102): same signature, server 92c3af4c logged 'cli starting' and nothing in 2 min. No other opencode run alive; 'opencode serve --service' (pid 48942, since ~17:36, ppid 1) was. Per D2217 the investigation is brought forward (started 23:21, Sonnet).\n\n\nResult (Sonnet, 2 Nov 23:41): cause found. With stdin not a terminal, opencode run waits for stdin EOF even with the prompt as an argument; an open pipe that never closes hangs it exactly as seen (server 'cli starting' then nothing). Repro: open pipe 2/2 hang; </dev/null 16/16 fine (reruns, fresh clones, production flags). Upstream anomalyco/opencode#59287 (open; triage says still on dev); 2.2.5 (nixpkgs-unstable) likely still hangs (fake-model test). Project.resolve stack was the idle server's startup fiber being cancelled. Not the serve --service process, not concurrency, not 2.1.4 (the wait is in v1 too, #38723). opencode comes from home.packages in ~/.config/nix-darwin/home/matt.nix:28. Workaround applied: </dev/null in CLAUDE.md and docs/workflow.md. Close after a few real runs start cleanly with it.\n",
36553655
"created": "2026-11-02",
36563656
"updated": "2026-11-02",
36573657
"commits": []

‎docs/workflow.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ implementation start, usually in stages.
4646
The brief also gives a time estimate; the run stops and reports at 1.5×
4747
it, and the orchestrator watches the elapsed time and stops a run at 2×
4848
that is going in circles (D2216; `CLAUDE.md`, "Choosing the model").
49-
Run it with `--print-logs`, so its log shows activity. A run that logs
50-
nothing past its server's start within 2 minutes has hung (seen with
51-
OpenCode 2.1.4, 2 Nov 2026, at startup in `Project.resolve`): stop it and
52-
start it again (D2217).
49+
Run it with `--print-logs`, so its log shows activity, and with stdin
50+
from `/dev/null`: given an open pipe as stdin, `opencode run` waits for
51+
it to close and never starts (SW-1097; upstream anomalyco/opencode#59287,
52+
open on 2.1.4 and 2.2.x). A run that still logs nothing past its server's
53+
start within 2 minutes has hung some other way: stop it, start it again,
54+
and record it on SW-1097 (D2217).
5355
3. Opus reviews the diff line by line and reruns the tests it relies on.
5456
DeepSeek has introduced real bugs before, and once handed over a test it
5557
had never run, so its own "tests pass" isn't enough.

0 commit comments

Comments
 (0)