Repository navigation
feat: download nightly images with progress and update them in the background - #36
Merged
Merged
Conversation
insertt
force-pushed
the
feat/nightly-image-download
branch
from
December 2, 2026 19:11
641f0b7 to
c6135d2
Compare
…round sand now downloads a nightly image itself instead of leaving the pull to `sbx create`, which showed only the elapsed time: it asks the registry for the host's build, streams the layers into an OCI archive while checking each digest, and shows a bar with bytes, percent, speed and time left (in Tern's native setup too). The archive is loaded with `sbx template load` and the sandbox created with `--pull never`; a build already loaded is not downloaded again. If sand cannot download or load it, sbx pulls it as before (`--pull always`). Launching no longer asks the registry about newer builds. A session looks in the background (20s in, then every 3h). `nightly_updates` decides what happens when there is one: "ask" (default) offers the download in a card, "auto" downloads it right away, "off" does not look. Once loaded, a card asks whether to restart sand on it: the agent is stopped and sand runs again with the same arguments, recreating the sandbox from the new image with its mounts, MCP servers and history. The cards are the native session's own, or sand's card in its Tern pane (system dialog outside Tern) for the agent's terminal UI; both take custom button labels now.
…failed The updater runs unseen and only retried on failure. It now notes each step (the build found, download, load, the restart question and its answer, any failure) in update.log in the sandbox's directory, and a failed `sbx template load` reports all it printed rather than its last line.
Path is used only under cfg(unix), so on Windows the import was unused and failed the build under -D warnings.
Switching to a new image forgets the sandbox's record before writing it again; the e2e test read it every 50ms and panicked when it landed in that gap (seen on macOS).
insertt
force-pushed
the
feat/nightly-image-download
branch
from
December 2, 2026 20:30
c6135d2 to
5a18488
Compare
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.
Stacked on #35; the base will move to
mainonce that merges.feat: download nightly images with progress, update them in the background
sand now downloads a nightly image itself instead of leaving the pull to
sbx create, which showed only the elapsed time: it asks the registry forthe host's build, streams the layers into an OCI archive while checking
each digest, and shows a bar with bytes, percent, speed and time left (in
Tern's native setup too). The archive is loaded with
sbx template loadand the sandbox created with
--pull never; a build already loaded is notdownloaded again. If sand cannot download or load it, sbx pulls it as
before (
--pull always).Launching no longer asks the registry about newer builds. A session looks
in the background (20s in, then every 3h).
nightly_updatesdecides whathappens when there is one: "ask" (default) offers the download in a card,
"auto" downloads it right away, "off" does not look. Once loaded, a card
asks whether to restart sand on it: the agent is stopped and sand runs
again with the same arguments, recreating the sandbox from the new image
with its mounts, MCP servers and history. The cards are the native
session's own, or sand's card in its Tern pane (system dialog outside Tern)
for the agent's terminal UI; both take custom button labels now.
fix: log what the nightly updater does, and say why loading an image failed
The updater runs unseen and only retried on failure. It now notes each step
(the build found, download, load, the restart question and its answer, any
failure) in update.log in the sandbox's directory, and a failed
sbx template loadreports all it printed rather than its last line.Checked locally on stable Rust:
cargo fmt --check,cargo clippy --all-targets --locked(with-D warnings) andcargo test --lockedpass.