diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef675a..3e3f26b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.6.15 + +- The gild VM (Multipass) keeps its gild at the same version as yours: setup installs your version, and after you upgrade, the next `--vm` updates the VM's copy first (a shown step). ## 0.6.14 - Linux x64: Firecracker v1.17.0 ships inside `@gildforge/cli-linux-x64` next to `gild` (Apache-2.0; LICENSE, NOTICE and THIRD-PARTY in `vendor/firecracker/`), checked against a pinned sha256 and the one Firecracker publishes. gild uses `vm.firecracker` from isolation.json, then the bundled one, then `firecracker` on PATH. diff --git a/src/isolation/multipass.ts b/src/isolation/multipass.ts index 5a8e34e..efae210 100644 --- a/src/isolation/multipass.ts +++ b/src/isolation/multipass.ts @@ -6,6 +6,7 @@ // repo-scoped token, so the agent clones, pushes and opens pull requests from // inside the VM. Your own gild key never enters it. Work leaves the VM through // git; the session's copy stays in the VM until you remove it. +import pkg from '../../package.json' import { spawn, spawnSync } from 'node:child_process' import { readFileSync } from 'node:fs' import { readFile } from 'node:fs/promises' @@ -43,7 +44,7 @@ const SETUP = `set -e export DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq sudo apt-get install -y -qq git nodejs npm python3 build-essential ca-certificates >/dev/null -sudo npm install -g --silent @anthropic-ai/claude-code gildforge +sudo npm install -g --silent @anthropic-ai/claude-code gildforge@${pkg.version} touch ${READY}` /** The multipass binary's full path: the pty helper runs a path, not a name. */ @@ -218,7 +219,7 @@ export async function ensureVm(log: (line: string) => void = () => {}) { ]), ) const setup = () => - log('setting up the gild VM (first time only, about two minutes)') + log('setting up the gild VM (first time only, a few minutes)') if (fresh) { setup() await step( @@ -241,7 +242,35 @@ export async function ensureVm(log: (line: string) => void = () => {}) { ) } else if (state !== 'Running') await step('Start the gild VM', ['start', MULTIPASS_VM], log) - if (isReady()) return + if (isReady()) { + // The VM's gild follows this one: an agent in the VM signs, clones and + // pushes with it, so an upgrade here upgrades it there. + const inside = mp([ + 'exec', + MULTIPASS_VM, + '--', + 'gild', + '--version', + ]).stdout.trim() + if (inside !== pkg.version) + await step( + `Update gild in the VM to ${pkg.version}`, + [ + 'exec', + MULTIPASS_VM, + '--', + 'sudo', + 'npm', + 'install', + '-g', + '--silent', + '--prefer-online', + `gildforge@${pkg.version}`, + ], + log, + ) + return + } if (!fresh) setup() await step( 'Install Node, git, Claude Code and gild',