anomalyco / anomalyco/opencode
Concurrent runs can fail on shared snapshot gc.pid.lock
@jlongster is already working on this.
Since Sep 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Bug
OpenCode 1.18.30 can fail a concurrent opencode run because snapshot cleanup races on the shared global Git snapshot repository.
Observed on macOS during a real long-running soak with one project and multiple concurrent opencode run --auto processes:
cleanup failed exitCode=128
fatal: Unable to create `/Users/abu/.local/share/opencode/snapshot/global/<snapshot>/gc.pid.lock`: File exists.
Another git process seems to be running in repository, or lock file may be stale
The Memory V1 backend remained healthy during the same run: 17 real sessions, 790 native sources, 302 tool starts, 0 failed memory jobs, 0 pending jobs. One OpenCode process exited non-zero due to the snapshot lock contention.
Expected
Concurrent sessions should serialize snapshot GC, retry lock contention, or treat a competing cleanup as non-fatal without failing the user session.
Reproduction
- Use one OpenCode project/worktree.
- Start two or more
opencode run --autoprocesses concurrently. - Let them perform normal read/tool work so snapshot tracking and cleanup run.
- Observe
cleanup failedand occasional non-zero session exit.
Tracking report in the affected integration: https://github.com/Abuarchiv/agent-memory-v1/issues/1
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.