-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Description
The snapshot feature accumulated 170GB of disk space on my Mac. The git objects in ~/.local/share/opencode/snapshot/ grew unchecked over time.
Root Cause
Looking at packages/opencode/src/snapshot/index.ts:
- The entire worktree is tracked via git
- Cleanup only runs hourly via scheduler with
git gc --prune=7.days - No disk space warning when snapshot grows large
- Temporary pack files (
tmp_pack_*) may not be cleaned up if opencode crashes
Steps to Reproduce
- Use opencode regularly over time
- Check
~/.local/share/opencode/snapshot/directory size - In my case:
du -sh ~/.local/share/opencode/snapshot/showed 170GB
Workaround
- Delete the snapshot directory:
rm -rf ~/.local/share/opencode/snapshot/ - Disable snapshot in config:
{"snapshot": false}
Suggested Fix
Add a disk space warning when the snapshot directory exceeds a threshold (e.g., 1GB). This would alert users before the problem gets out of hand.
I'm willing to submit a PR for this if the maintainers agree with the approach.
Environment
- OS: macOS Sequoia 15.3
- OpenCode: latest (via brew)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)