Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions scripts/check_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
import tarfile
import tempfile
import time
from pathlib import Path

REPO = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -321,12 +322,16 @@ def init(base: Path, home: Path, dest: Path, *args: str) -> subprocess.Completed
sb.start()
warn = sb.run("debug", "config").stderr.strip()
check("opencode loads the bare config without warnings", warn == "", warn[:200])
models = {m["id"] for m in sb.get_data("/api/model") if m.get("providerID") == "onyxia"}
check(
"the 3 onyxia models are available",
models == set(full_cfg["providers"]["onyxia"]["models"]),
str(sorted(models)),
)
# The first request for a directory starts a fresh opencode instance, which (seen with v2.4.2)
# can answer /api/model before the config-defined `onyxia` provider is registered: poll.
want_models = set(full_cfg["providers"]["onyxia"]["models"])
deadline = time.monotonic() + 30
while True:
models = {m["id"] for m in sb.get_data("/api/model") if m.get("providerID") == "onyxia"}
if models == want_models or time.monotonic() > deadline:
break
time.sleep(0.5)
check("the 3 onyxia models are available", models == want_models, str(sorted(models)))
agents = {a["id"]: a for a in sb.get_data("/api/agent")}
check(
"none of the shipped custom agents exist",
Expand Down
Loading