anomalyco / anomalyco/opencode
Intermittent hang at 'booting location services': silent idle, no CPU/net; headless repro (resume existing session); references #35870/#41934
Open
@rekram1-node is already working on this.
Since Sep 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Environment
- opencode 1.18.30 (latest at 2026-09-12), Linux x86_64, latest channel
- Effect
@effect/... 4.0.0-beta.83(per the root cause described in #35870)
Symptom
Startup intermittently hangs at the "booting location services" phase:
- Phase 1 (load/config/init) completes fast (~2-5s,
all LSPs/init countlogged). booting location servicesis logged, then the log goes completely silent and the
process idles: main thread inepoll_wait/cond-wait, 0% CPU, no disk, no sockets.- The session is never created (
created id=...never logs). Hangs I captured lasted
150s, 173s, 1519s and "forever" (killed by watchdog).
It is intermittent: the same command in the same directory alternates between completing
the location boot in under a second and hanging for minutes.
Empirical isolations (all reproduced headlessly, no TUI involved)
- Reproduces in a fresh scratch dir with an empty
opencode.json(no plugins, no
project config) => not plugin/provider/cwd related.opencode run -c ...(fresh session)
andopencode run --session <existing-session> -c ...are both affected. - With
HTTP_PROXY/HTTPS_PROXY/ALL_PROXYpointed at a 502-returning logging CONNECT proxy,
the boot still hangs with ZERO sockets open => the stall is a local effect await,
not a network egress issue. - SQLite (
memory.db)IMMEDIATElock acquired instantly during a hang => not a DB lock. - 16/16 cold boots completed (3-23s) under pure CPU load (4x
yes), but hangs are
provoked by parallel cold boots (2-4 concurrent opencode instances / the TUI
booting an existing project dir eagerly) - matching #35870's "scheduler/memory pressure". opencode serve+POST /sessionboots lazily and creates a session in ~5s without
hanging; the interactive TUI (andrun --session) creates/attaches its location eagerly
at startup, which is the path that strands.
Repro
# 1) create a session quickly
opencode run --dir /tmp/ocr-repro -c "hi" --print-logs # fast; note the session id
# 2) resume it (this routes through the eager location boot that intermittently hangs)
for i in $(seq 1 10); do
opencode run --dir /tmp/ocr-repro --session <id> -c "hi" --print-logs &
done
A fraction of the instances stall right after booting location services with a silent
log and no session created; they must be killed. Kill + retry makes the same command
complete fine.
References
- #35870 (same root cause:
InstanceStore.loadbootDeferred+ effect beta.83 runLoop
re-entrancy guard -> lost wakeup). This issue adds a headless repro + "not network /
not plugins / not DB" isolation and the--sessioneager-location-boot trigger. - #41934 (unguarded
Npm.install/arboristreifyalso stalls startup when the registry
is slow; observed as a separate first-phase delay of 12-120s on the npm-plugin config).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.