feat: match the supervisor image to the gateway, allow pinning prerequisites - #33
Merged
Merged
Conversation
…uisites The supervisor image tag was hardcoded to 0.0.96 while OpenShell's own installer resolves its latest release, so a host running gateway 0.0.97 booted every sandbox with a 0.0.96 supervisor. That is a silent version mismatch, not a cosmetic one: the supervisor runs inside the sandbox and speaks the gateway's protocol. Nothing detected or reported it. The driver now reads `openshell-gateway --version` (the compute contract carries no gateway version, and the driver shares the host with the gateway) and uses the matching supervisor tag. An explicit --supervisor-image / OSHL_AC_SUPERVISOR_IMAGE still wins, and if the matching tag is unpublished the single extraction call site falls back to the pinned image so a create cannot regress into failing outright. Only the driver's own release was selectable before; the prerequisites always resolved to latest, which made installs irreproducible and left no way to roll back a bad upstream release. Both upstreams support pinning, so pass it through: install.sh gains --openshell-version and --container-version (env OSHL_AC_OPENSHELL_VERSION, OSHL_AC_CONTAINER_VERSION), and `update --all` gains the same two flags. OpenShell pinning runs its official installer with OPENSHELL_VERSION set (downloaded to a file first, so a truncated fetch cannot execute as a partial script); apple/container uses `update-container.sh -v`. setup now prints the resolved driver / gateway / apple-container versions plus the supervisor image, and warns when the tag does not match the gateway, so this class of drift is visible instead of silent. Verified live: setup switched 0.0.96 -> 0.0.97 against the installed gateway, and a sandbox reached Ready on the derived supervisor (cache shows supervisor-0.0.97) with exec working. Signed-off-by: Vyncint Ng <vyncint@users.noreply.github.com>
vyncint
added a commit
that referenced
this pull request
Aug 5, 2026
Supervisor image now tracks the installed gateway version; prerequisites are pinnable; setup reports the component versions (#33). Signed-off-by: Vyncint Ng <vyncint@users.noreply.github.com> Co-authored-by: Vyncint Ng <vyncint@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Started as "should we allow selecting OpenShell / apple-container versions?" — and turned up a live version mismatch on the reference machine, which this PR fixes alongside the requested feature.
1. Bug: the supervisor image tag didn't track the gateway
--supervisor-imagedefaulted to a hardcoded…/supervisor:0.0.96, but OpenShell's installer resolves its own latest release. On the reference machine that meant:supervisor:0.0.97on the registryThe supervisor runs inside every sandbox and speaks the gateway's protocol, so this is a silent protocol mismatch, and nothing detected or reported it. It happened to work (0.0.96 ↔ 0.0.97 are compatible) — luck, not design.
update --allrunsbrew upgrade openshell, which can move the gateway independently at any time.Fix: the driver reads
openshell-gateway --versionand uses the matchingsupervisor:<version>. The compute-driver contract carries no gateway version, and the driver shares the host with the gateway, so the binary is the only source. Guardrails:--supervisor-image/OSHL_AC_SUPERVISOR_IMAGEalways wins (detected viaflag.Visit+ env lookup).config.Parse, so resolution is an explicit call after parsing; forgetting it degrades to the pinned tag, never to an empty image.2. Feature: pin the prerequisites
Only the driver's own release was selectable; OpenShell and apple/container always resolved to latest — installs weren't reproducible and a bad upstream release couldn't be rolled back. Both upstreams already support pinning, so this is pass-through:
curl -LsSf …/install.sh | sh -s -- --version v0.2.6 --openshell-version 0.0.97 --container-version 1.2.0 openshell-driver-applecontainer update --all --openshell-version 0.0.97 --container-version 1.2.0OPENSHELL_VERSION.brewcan't install an arbitrary tap version, so a pin routes through the official installer — downloaded to a file and run assh <file>, not piped into a shell, so a truncated fetch can't execute as a partial script.update-container.sh -v <ver>; the.pkgURL is already tag-based.OSHL_AC_OPENSHELL_VERSION,OSHL_AC_CONTAINER_VERSION. Defaults stay "latest" so users keep getting fixes; pinning is opt-in.--openshell-version/--container-versionwithout--allis rejected rather than silently ignored.3. Visibility
setupnow logs the resolved driver / gateway / apple-container versions and the supervisor image, and warns when the tag ≠ gateway. The README compatibility table said "pinned to v0.0.96", which no longer matched reality — corrected, and the pinning recipes documented.Verification
setuploggedmatched the supervisor image to the installed gateway gateway_version=0.0.97, then a sandbox reached Ready on the derived image — cache showssupervisor-0.0.97-523e0565f895alongside the old0.0.96— withexecreturning kernel6.18.15. Version summary printeddriver / gateway 0.0.97 / apple_container 1.2.0and no mismatch warning.Parserecords explicitness) and version probing (gateway + container +v-prefix + junk + missing binary) with mismatch-warning assertions.go test -race ./...,golangci-lint(0 issues),shellcheck,make secall clean.install.sh -hnow prints the header robustly (it was about to leakset -euas the header grew).Also fixed while here:
cleanup -dremoves the supervisor image the driver actually uses, not just the pinned default.