Disable OpenCode filesystem snapshots

This commit is contained in:
Nick Sweeting 2026-09-03 11:50:09 -07:00
parent cde3542961
commit e7ff7cdad2
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,8 @@ _CONFIG_PATH = Path(opencode_plugin.__file__).with_name("config.json")
_DEFAULT_MODEL = "opencode/big-pickle"
_DEFAULT_CONFIG = f'''{{
"$schema": "https://opencode.ai/config.json",
"model": "{_DEFAULT_MODEL}"
"model": "{_DEFAULT_MODEL}",
"snapshot": false
}}
'''

View File

@ -411,6 +411,7 @@ def test_opencode_starts_with_isolated_state(live_opencode):
assert Path(live_opencode.settings["workdir"]).resolve() == Path(workdir)
assert Path(str(project.json()["worktree"])).resolve() == Path(workdir)
assert config.json()["model"] == "opencode/big-pickle"
assert config.json()["snapshot"] is False
assert live_opencode.process.poll() is None
assert (live_opencode.config.data_dir / ".git").is_dir()
assert (state_dir / "data" / "opencode" / "opencode.db").is_file()
@ -442,7 +443,9 @@ def test_opencode_state_dir_is_separate_from_workdir(tmp_path):
assert loaded_skill.is_symlink()
assert loaded_skill.resolve() == editable_skill.resolve()
assert f"ArchiveBox collection directory: {settings['archivebox_data_dir']}" in editable_skill.read_text()
assert json.loads((state_dir / "config" / "opencode" / "opencode.jsonc").read_text())["model"] == "opencode/big-pickle"
opencode_config = json.loads((state_dir / "config" / "opencode" / "opencode.jsonc").read_text())
assert opencode_config["model"] == "opencode/big-pickle"
assert opencode_config["snapshot"] is False
@pytest.mark.parametrize(