anomalyco / anomalyco/opencode
Desktop: snapshot's `git add --sparse --pathspec-from-file=-` hangs indefinitely blocked on stdin (not a zombie — process stays alive in `Ss` state)
@Hona is already working on this.
Since Aug 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Environment
- OpenCode Desktop v1.18.15 (Electron, packaged), macOS
- Custom OpenAI-compatible provider (self-hosted llama.cpp), but confirmed unrelated to backend (see below)
Description
When running an agent task in a specific project, the Desktop UI gets stuck in "thinking" indefinitely. Root cause is a hung local git subprocess spawned by the snapshot/checkpoint feature — the LLM backend itself has already finished responding.
Reproduction (3/3 times, immediately, on this project)
ps -o pid,etime,time,stat,command -p <pid>
ELAPSED TIME STAT COMMAND
14:19 0:01 Ss git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true \
--git-dir /Users/.../.local/share/opencode/snapshot/<hash1>/<hash2> \
--work-tree /Users/.../project \
add --all --sparse --pathspec-from-file=- --pathspec-file-nul
- Process is alive (
Ss, sleeping/session-leader) — not a zombie/defunct child like #40439 - Near-zero CPU time (0:01-0:00.78) across 14+ minutes elapsed — genuinely blocked, not slow
- Holds an open
index.lockin the snapshot git-dir (confirmed vialsof) --pathspec-from-file=-reads the pathspec list from stdin; process appears blocked waiting for EOF on stdin that never arrives- Reproduced identically 3 times in a row, immediately after each retry, on the same project (~4200 files, 40MB, no unusual filenames/symlinks)
Confirmed NOT backend-related
Correlated with server-side request logs during the hang: the model had already finished generating (task released, GPU utilization back to 0%) while the Desktop UI still showed "thinking" — the hang is entirely in the local snapshot step, after the LLM response.
Workaround
kill <pid>+ remove the staleindex.lockunblocks the current turn, but recurs on retry for the same project- Setting top-level
"snapshot": falseinopencode.jsoncavoids the bug entirely (loses undo/revert capability) — this is what we ended up doing
Possibly related
#40439, #36370, #32981, #29413 - all snapshot-step hangs, but none match this exact symptom (live process blocked on stdin, not a zombie, not sidecar-stream-related, not Windows-specific)
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.