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)

Open
#41,648 2 comments 0 reactions 1 assignee View on GitHub

@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.lock in the snapshot git-dir (confirmed via lsof)
  • --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 stale index.lock unblocks the current turn, but recurs on retry for the same project
  • Setting top-level "snapshot": false in opencode.jsonc avoids 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.