You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: stale snapshot index.lock breaks Modified Files and undo for one workspace #22275
In one specific workspace, OpenCode stopped showing Modified Files, and revert undo messages and file changes no longer worked correctly. Other workspaces on the same machine were fine.
I traced it to a stale lock file in OpenCode's local snapshot cache for that workspace. The OpenCode logs repeatedly showed snapshot failures like:
fatal: Unable to create .../snapshot/<project-id>/<hash>/index.lock: File exists.
After removing the stale index.lock and then backing up/removing the workspace's snapshot cache under ~/.local/share/opencode/snapshot/<project-id>, the problem immediately went away.
This makes the workspace get stuck in a bad state where snapshot tracking is broken persistently, which seems to break both Modified Files and undo/revert behavior.
Plugins
None that seem relevant.
OpenCode version
1.3.7
Steps to reproduce
Use OpenCode in a git workspace until its local snapshot repo ends up with a stale index.lock under ~/.local/share/opencode/snapshot/<project-id>/.../index.lock.
Open that workspace again.
Make a file change through OpenCode.
Observe that Modified Files may not show up for that workspace, and revert undo messages and file changes does not correctly revert file changes.
Check OpenCode logs and see repeated snapshot failures with index.lock: File exists.
Remove the stale lock / reset the workspace snapshot cache, then restart OpenCode.
Observe that the workspace starts working normally again.
Screenshot and/or share link
I did not capture a share link, but I confirmed the root cause locally from the OpenCode log and snapshot cache.
This issue might be a duplicate of or related to existing issues. Please check:
Snapshot contention leaves lock artifacts and disk churn #15019: "Snapshot contention leaves lock artifacts and disk churn" — this closed issue tracked the same index.lock artifact problem under snapshot contention and was assigned for fixes. It's possible this is a regression or a case not fully covered by that fix.
Additional context: this looked workspace-specific, not global.
Other workspaces on the same machine were working normally.
Only this workspace lost Modified Files and had broken undo/revert.
The issue was resolved immediately after deleting the stale index.lock and resetting that workspace's snapshot cache under ~/.local/share/opencode/snapshot/<project-id>.
So this seems consistent with #15019 as a regression or an uncovered recovery path when a workspace snapshot repo gets stuck.
Activity
github-actions commentedon Apr 13, 2026
This issue might be a duplicate of or related to existing issues. Please check:
index.lockartifact problem under snapshot contention and was assigned for fixes. It's possible this is a regression or a case not fully covered by that fix.FreeBardL commentedon Apr 13, 2026
Additional context: this looked workspace-specific, not global.
Modified Filesand had broken undo/revert.index.lockand resetting that workspace's snapshot cache under~/.local/share/opencode/snapshot/<project-id>.So this seems consistent with #15019 as a regression or an uncovered recovery path when a workspace snapshot repo gets stuck.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.