Repository navigation
Conversation
…as an asset for io.pilot.smol 1.2.0 published a darwin/amd64 adapter bundle although install.json has no smolvm for darwin/amd64 (upstream ships none). The bundle was left unlisted, but it exits 1 on every spawn: "install assets: stage: no asset for darwin/amd64". BuildBundle now builds DefaultPlatforms filtered to the asset platforms (BuildPlatforms); apps without assets still build for all four. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
….smol 1.2.1
Measured on io.pilot.smol 1.2.0 (darwin/arm64, real smolvm 1.2.0 VMs):
- an ephemeral `machine run` VM is orphaned (ppid 1, own process group)
when its CLI gets SIGTERM or SIGKILL: app stop, group stop, call deadline.
smolvm tears it down only on SIGINT.
- VMs from `machine start` and `machine run -d` keep running after the app's
SIGTERM, the supervisor's SIGKILL and the supervisor's death.
New passthrough route options:
- cli.env_rules: environment for the child of a matching call. smol sets
SMOLVM_BOOT_BINARY=${command_dir}/smolvm-bin for a foreground run, which
arms smolvm's own parent-death watchdog in the VM (manager.rs).
- cli.teardown: a matching call opens a record "run <stop argv>"; the
adapter runs open records on a clean stop, and the child guard (which stays
up while records are open) runs them if the adapter is killed. An explicit
stop/delete closes the record; a failed start closes what it opened.
smol.exec declares both; the description says VMs stop with the app.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A/B report —
|
| Command | Vanilla ms | Pilot ms | Δ | Exit match |
|---|---|---|---|---|
| Version | 5 | 6 | +1 | ✓ |
| Top-level help | 4 | 6 | +2 | ✓ |
| machine --help | 4 | 6 | +2 | ✓ |
| pack --help | 4 | 6 | +2 | ✓ |
| config --help | 4 | 6 | +2 | ✓ |
TeoSlayer
marked this pull request as draft
October 1, 2026 14:31
Contributor
Author
|
Converted to draft rather than merged. It is based on draft #115 and carries its commits, the description says product still has to sign off on VMs stopping with the app, and the smol 1.2.1 bundles are not in R2 yet (publish-on-merge would fail). It also needs rework after #116 landed today: |
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 #115 (
fix/redis-lifecycle), which is stacked on #114 and #111. This PR uses their child guard (childguard.go), shutdown drain,watchParentand cancel-with-SIGTERM, and adds two commits. Review those PRs first. Once they merge, retarget this PR tomain.Problem
These leaks were measured on the published io.pilot.smol 1.2.0 darwin/arm64 bundle, running real smolvm 1.2.0 VMs. The supervisor's spawn flags were used, with an isolated HOME and app dir.
smol.exec ["machine","run",…]was stopped mid-run by an app SIGTERM. Its VM process was left running:LEFT 61336 ppid=1 pgid=61336 smolvm-bin _boot-vm …, still alive 20 s later. Upstreammachine runtears its VM down only on SIGINT (SigintGuard), and SIGTERM or SIGKILL of the CLI orphans it. The earlier sweep saw the same after a process-group SIGTERM (2/2) and after the 60 s call deadline (1/1).machine start --name t1andmachine run -d --name t2were followed by an app SIGTERM. Both VMs wereLEFT … ppid=1, andmachine lsstill showed themrunning30 s later. The earlier sweep found the same after the supervisor's SIGKILL. Nothing stops them on uninstall.BuildBundlebuilds all 4DefaultPlatforms, although install.json has no smolvm for darwin/amd64 (upstream ships none). The unlistedio.pilot.smol-1.2.0-darwin-amd64.tar.gzon R2 exits 1 on every spawn:no asset for darwin/amd64.Fix
cli.env_rules(passthrough only) adds environment to the child of a matching call. smol setsSMOLVM_BOOT_BINARY=${command_dir}/smolvm-binfor amachine runwithout-d/--detach. That arms smolvm's own parent-death watchdog in the VM process (src/agent/manager.rs,watch_parent), so the VM dies with its CLI whatever signal the CLI gets. A detached run does not get the variable: its VM has to outlive the CLI.cli.teardown(passthrough only) handles a call that leaves something running outside the process group. When a call matches, a record is opened: "run<base> <run argv>with this env", with${name}taken fromname_flagsordefault_name. The record is opened before the CLI runs, so a start that is cut short is still covered.watchParentseeing the daemon gone): main runs every open record (30 s each, concurrently) before it releases the guard.clear_prefixesfor the same name closes it, so nothing is stopped twice. A start that exits non-zero closes the record it opened.--, so a guest command's own flags don't count.smol.exec declares two teardown rules:
machine start: stopped withmachine stop --name ${name}(default namedefault).machine run -d|--detach: stopped the same way.The smol.exec description now says that VMs stop when the app stops and that their disks persist. This is a behaviour change: product needs to sign off on it. The version is bumped to 1.2.1.
BuildPlatforms: an app with native assets is built only for the platforms it has an asset for. smol now builds darwin/arm64, linux/amd64 and linux/arm64.Verification
GOWORK=off go test ./... -count=1: all packages ok. That includes the new tests:TestCLITeardownE2E, which uses a fake smolvm that models the VM's own process group, the watchdog and the SIGINT-only teardown.TestValidateCLILifecycleTestBuildPlatforms_AssetsLimitTargetsTestCLITeardownE2Epassed 3 times out of 3 (-count=3).LifecycleGoreturning ""), 7 of the 8 subtests fail. The 8th only checks that nothing is stopped needlessly.Real smolvm 1.2.0 on darwin/arm64, using bundles built from this branch with a test-only publisher key:
machine runin flight, app SIGTERMmachine start+run -d, app SIGTERMmachine ls= runningmachine ls= stoppedmachine stop)machine run … echo hi-from-vmhi-from-vm; 0 VMs afterOther checks:
smol.version×200:machine fork,pack runand the hiddenmachine network-test(which auto-starts a VM) have no teardown rule.$HOME(~/Library/Caches/smolvm), so disks persist after uninstall.machine stopfrom$APPwhile uninstall deletes$APPis untested.Release (needs maintainers)
ed25519:54rnZ8…). That produces 3 platforms.bundles/io.pilot.smol/1.2.1/. Never overwrite 1.2.0.bundlesmap, plus top-levelbundle_url/bundle_sha256/bundle_sizefrom linux/amd64. Then re-sign catalogue.json.🤖 Generated with Claude Code