Resolve configured host models during native installation

Read OpenCode V2's resolved default Model.Info through its authenticated CLI API from HOME when saved profile fields are missing. Preserve valid saved models, explicit --model and unrelated settings. Record the selected stage model in the native server environment so web starters have an actual default.

Run the existing read-only model picker inside ./install when a terminal needs a choice; fail noninteractive or cancelled/incomplete setup before claiming ready or starting services. Do not parse JSONC, open login flows, create sessions or run inference. Document the one-step configuration path.

Checks: 61 mocked native installer/lifecycle tests, 8 entrypoint tests, sh -n install install.sh, git diff --check. API/schema checked against official OpenCode V2 documentation. No operator CLI/service/model calls, live install, restart, deployment or native Linux verification.
This commit is contained in:
2026-10-20 21:56:04 +01:00
parent d3c7e6e784
commit da6daa9db5
3 changed files with 218 additions and 22 deletions
+19 -5
View File
@@ -70,8 +70,12 @@ creates `bin/`, `lib/`, `data/`, `logs/` and `secrets/` (`secrets` and `data` at
authoring skill lands in your OpenCode skills directory. No `pipelines-tui` is
built. It writes `<prefix>/pipelines-install.json` atomically at 0600; that
manifest is what `scripts/manage.py` and the Go CLI load. Provider/model defaults
are never invented: your existing host OpenCode configuration is reused (an
explicit `--model` is recorded if supplied), and setup never starts a picker.
are never invented: valid saved Pipelines defaults are preserved, and an explicit
`--model PROVIDER/MODEL` fills missing OpenCode profile fields and is recorded as
the server's default for new starters. Otherwise setup reads OpenCode's resolved
host default using `opencode api get /api/model/default` from your home directory,
not the installer checkout. OpenCode handles its own JSONC and credentials; the
installer does not parse configuration files or generate a model response.
After the build, setup checks whether a **different** `pipelines` resolves earlier
on PATH than `<prefix>/bin/pipelines` (the common cause of a stale CLI talking to a
@@ -84,11 +88,21 @@ other binary, and it installs no unrelated tool; the manifest keeps
The native install also writes **host** harness profiles for the harnesses it
detects into XDG config home's `pipelines/harnesses.json` (no
`docker_directory`), preserving a valid host default (or choosing OpenCode instead
of a stale Docker default) and taking models from `--model` or the existing valid profile.
of a stale Docker default) and taking models from the saved profile, `--model`,
or OpenCode's actual configured default. The selected stage default is also
recorded as `PIPELINES_DEFAULT_MODEL` in the private manifest's server environment,
so web starters receive a real provider/model rather than `default/default`.
When migrating a Docker install it clears the recorded Docker link instead of
leaving the config Docker-linked. It never installs, upgrades or downloads a
harness. If no valid model can be resolved it writes nothing and points you at
`pipelines harness setup <opencode|pi> --host`.
harness. If no usable default exists, **`./install` itself opens the existing model
picker in a terminal**, choosing separate interactive and new-pipeline defaults
without logging in or performing inference. No separate configuration command is
needed. Noninteractive setup without a usable model fails before claiming ready
or starting services; pass `./install --model PROVIDER/MODEL` with an actual model
you have configured, or rerun `./install` in a terminal. Existing valid defaults,
credentials and unrelated profile fields are retained.
Discovery and selection do not verify an actual model generation or incur an
inference charge; provider execution remains a runtime check.
ntfy is built from source with no Homebrew or package manager. Setup resolves the
exact stable `binwiederhier/ntfy` tag (never the moving `latest` tag and never an