Skip to content

Desktop: snapshot's git add --sparse --pathspec-from-file=- hangs indefinitely blocked on stdin (not a zombie — process stays alive in Ss state) #41648

Description

@v0id-byte

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 opencode -c/-i TUI sessions hang permanently: zombie git child under project-copy-refresh snapshot step #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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions