Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
35 changes: 32 additions & 3 deletions src/isolation/multipass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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(
Expand All @@ -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',
Expand Down
Loading