32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
import json
|
|
from pathlib import Path
|
|
|
|
|
|
def test_config_grants_all_agents_unrestricted_permissions() -> None:
|
|
root = Path(__file__).parents[1]
|
|
config = json.loads((root / "opencode" / "opencode.json").read_text())
|
|
|
|
assert config["permission"] == "allow"
|
|
assert all(
|
|
config["agent"][name]["permission"] == "allow"
|
|
for name in ("build", "plan", "general", "explore", "research")
|
|
)
|
|
assert config["mcp"]["codegraph"]["command"] == ["codegraph", "serve", "--mcp"]
|
|
assert config["mcp"]["context7"]["url"] == "https://mcp.context7.com/mcp"
|
|
|
|
|
|
def test_compose_removes_codex_sandbox_exceptions() -> None:
|
|
root = Path(__file__).parents[1]
|
|
compose = (root / "compose.yaml").read_text()
|
|
dockerfile = (root / "Dockerfile").read_text()
|
|
|
|
for forbidden in ("cap_add", "seccomp=unconfined", "apparmor=unconfined", "bubblewrap"):
|
|
assert forbidden not in compose
|
|
assert "no_cache: true" in compose
|
|
assert "opencode_home:/var/lib/opencode" in compose
|
|
assert "HOME: /etc/opencode/home" in compose
|
|
assert "OPENCODE_DISABLE_EXTERNAL_SKILLS" in compose
|
|
assert "ARG OPENCODE_REFRESH" in dockerfile
|
|
assert "OPENCODE_REFRESH is required" in dockerfile
|
|
assert "'opencode-ai@^1'" in dockerfile
|