Description
Hi there. First of all, thanks for the team for their phenomenal work on OpenCode. This tool is a killer 💯
Starting from 1.16.0 (and still persisting in 1.16.2), I am unable to use opencode run inside a folder that is not a git repo with snapshot config set to false. My guess is that snapshot: false stopped working and for some reason snapshot: true requires a git repo? Not sure. Please find the minimal steps to reproduce. I am running it in a clean docker container to ensure no external factors are affecting the behavior. It used to work perfectly up until 1.15.13 (meaning running with snapshot set to false in directory that is not a git repo).
Plugins
No response
OpenCode version
1.16.2
Steps to reproduce
1. Run bash in node docker container, install curl, git and nano as root and then switch to a regular user node:
daniel@inspiron-14-5410:~/Documents/Projects/ai/$ docker run -it node:26.1.0-bookworm-slim bash
root@589e1bd6a50b:/# apt-get update && apt-get install curl git nano -y
# packages installation output
root@589e1bd6a50b:/# su - node
2. Install OpenCode, configure snapshot config to false, preview config and prepare ~/workspace workdir:
node@589e1bd6a50b:~$ curl -fsSL https://opencode.ai/install | bash
# opencode installation output
node@589e1bd6a50b:~$ source ~/.bashrc # get opencode to $PATH
node@589e1bd6a50b:~$ mkdir -p /home/node/.config/opencode/
node@589e1bd6a50b:~$ nano /home/node/.config/opencode/opencode.jsonc
node@589e1bd6a50b:~$ cat /home/node/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"snapshot": false
}
node@589e1bd6a50b:~$ opencode debug config
{
"$schema": "https://opencode.ai/config.json",
"snapshot": false,
"agent": {},
"mode": {},
"plugin": [],
"command": {},
"username": "node"
}
node@589e1bd6a50b:~$ mkdir workspace && cd workspace
3. Try opencode run with the most basic prompt
node@589e1bd6a50b:~/workspace$ opencode run "please just say hi to me"
> build · big-pickle
node@589e1bd6a50b:~/workspace$
No output from LLM.
4. Enable snapshots and try again:
node@589e1bd6a50b:~/workspace$ nano /home/node/.config/opencode/opencode.jsonc
node@589e1bd6a50b:~/workspace$ cat /home/node/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"snapshot": true
}
node@589e1bd6a50b:~/workspace$ opencode run "please just say hi to me"
> build · big-pickle
node@589e1bd6a50b:~/workspace$
Still no output from the LLM.
5. Init the repo and try again:
node@589e1bd6a50b:~/workspace$ git init
Initialized empty Git repository in /home/node/workspace/.git/
node@589e1bd6a50b:~/workspace$ opencode run "please just say hi to me"
> build · big-pickle
Hi
node@589e1bd6a50b:~/workspace$
It worked as expected this time 💪
6. Disable snapshots again to confirm it's not just about running it in a git repo:
node@589e1bd6a50b:~/workspace$ nano /home/node/.config/opencode/opencode.jsonc
node@589e1bd6a50b:~/workspace$ cat /home/node/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"snapshot": false
}
node@589e1bd6a50b:~/workspace$ opencode run "please just say hi to me"
> build · big-pickle
node@589e1bd6a50b:~/workspace$
Again no output.
Conclusion
It only works when snapshots: true and running in a git repo dir.
Screenshot and/or share link
No response
Operating System
Ubuntu 24.04 or node docker container
Terminal
Ubuntu's default
Description
Hi there. First of all, thanks for the team for their phenomenal work on OpenCode. This tool is a killer 💯
Starting from 1.16.0 (and still persisting in 1.16.2), I am unable to use
opencode runinside a folder that is not a git repo withsnapshotconfig set tofalse. My guess is thatsnapshot: falsestopped working and for some reasonsnapshot: truerequires a git repo? Not sure. Please find the minimal steps to reproduce. I am running it in a clean docker container to ensure no external factors are affecting the behavior. It used to work perfectly up until 1.15.13 (meaning running withsnapshotset tofalsein directory that is not a git repo).Plugins
No response
OpenCode version
1.16.2
Steps to reproduce
1. Run bash in
nodedocker container, install curl, git and nano as root and then switch to a regular usernode:2. Install OpenCode, configure
snapshotconfig tofalse, preview config and prepare~/workspaceworkdir:3. Try
opencode runwith the most basic promptNo output from LLM.
4. Enable snapshots and try again:
Still no output from the LLM.
5. Init the repo and try again:
It worked as expected this time 💪
6. Disable snapshots again to confirm it's not just about running it in a git repo:
Again no output.
Conclusion
It only works when snapshots: true and running in a git repo dir.
Screenshot and/or share link
No response
Operating System
Ubuntu 24.04 or node docker container
Terminal
Ubuntu's default