anomalyco / anomalyco/opencode
"Snapshot mechanism stalls on large workspaces: ~1min per git snapshot, permanent index.lock deadlock after a crash"
Open
@neriousy is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
On a large git workspace (~5,300 tracked files) running opencode 1.18.18 on Windows, the project snapshot mechanism becomes pathological:
- Every agentic iteration triggers a full
git add -A+git commitinside a custom snapshot repository. On a large workspace each of these takes ~1 minute (git add -A≈ 57s,git commit≈ 19s measured locally), so every single model interaction is blocked for ~1 minute before anything is sent. - When a snapshot git process crashes (or is killed), it leaves a stale
index.lockin the snapshot repository. From then on, every snapshot operation fails withfatal: Unable to create '...index.lock': File existsand opencode retries indefinitely — memory balloons to 6–8 GB, disk reads exceed 10 GB, and no response is ever produced. The only fix is to manually delete theindex.lockfile.
Plugins
No response
OpenCode version
1.18.18
Steps to reproduce
- Open a large repo (several thousand tracked files) in opencode on Windows.
- Verify the snapshot git repo under
~/.local/share/opencode/snapshot/<projectID>/...:- Run
git add -Ain that repo → observe tens of seconds. - Run
git commit→ same.
- Run
- Trigger a snapshot operation and then kill the opencode process mid-operation → a stale
index.lockis left behind. - Restart opencode in the same directory → every interaction now logs:
The session becomes unresponsive: ~6–8 GB RSS, continually increasing disk reads, and no answer is returned, because snapshot never succeeds and opencode retries forever.WARN level=WARN message="failed to add snapshot files" exitCode=128 stderr="fatal: Unable to create '.../snapshot/.../index.lock': File exists. Another git process seems to be running in this repository..."
Screenshot and/or share link
No response
Operating System
windows
Terminal
No response
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.