wirenboard-agent-vm/npm-dist/agent-vm/README.md
Evgeny Boger 494b8dd0aa distribution: address code-review findings before v0.1.0
Top fixes from the max-effort review:

**Correctness:**

1. setup.rs::verify_image now calls image_api_version::check() and
   runs each agent --version separately. Old code did
   `cat ... && claude --version && ...` so a non-zero exit could
   mean any of four causes; error message blamed only the API file.
   New code names which check failed.

2. main.rs runs `point_at_msb` BEFORE constructing the tokio
   runtime. setenv() is not thread-safe; the previous code ran
   `unsafe { set_var }` after `#[tokio::main]` had already spawned
   workers, technically UB if a worker read env concurrently
   (reqwest / sea-orm do this on first use). Switched to plain
   `fn main` + manual Runtime::new() so the env mutation happens
   single-threaded.

3. release-npm.yml cache key now includes a hash of `rustc -V`.
   Without this, an ubuntu-latest rustc rollover (we hit this
   exact bug locally this session) reused cached rlibs from the
   prior toolchain → undefined-symbol link errors.

4. release-npm.yml's subpackage publish loop is now idempotent:
   skips already-published versions instead of erroring. Avoids
   the split-state where a transient failure leaves subpackages
   at v but the main package never published.

5. build-image.yml's retention switched from
   `actions/delete-package-versions@v5`'s `min-versions-to-keep:
   350` (which breaks if cron is paused for days) to an explicit
   age-based prune via actions/github-script — deletes versions
   older than 14 days regardless of build cadence.

**UX:**

6. pull.rs adds `AGENT_VM_INSECURE_REGISTRY=1` env-var escape hatch
   so airgapped/intranet plain-HTTP registries
   (`registry.corp.example:5000`) can opt in. The hostname
   heuristic stays narrow (localhost/127.0.0.1/0.0.0.0/*.local/
   *.localhost) for safety.

7. msb_install.rs: MSB_PATH set-but-file-missing now falls back to
   the sibling-of-current_exe() if one exists (with a warn) and
   gives a much clearer error otherwise. The vanilla-msb rejection
   message now detects MSB_PATH presence and tells the user to
   unset it instead of generically suggesting "set MSB_PATH
   explicitly" (the LAST thing they need to hear when they just set
   it).

8. setup.rs warns when running from a source checkout (manifest_dir
   has images/Dockerfile) but the submodule isn't initialised —
   instead of silently pulling ghcr.io and confusing the dev who
   just edited images/Dockerfile.

9. npm-dist/agent-vm/bin/agent-vm.js' missing-optional error lists
   network-flake as the top cause (it is) plus --no-optional and
   inconsistent lockfile pinning. Previously blamed --no-optional
   as the most likely cause, which it usually isn't.

10. README files for both npm packages so npmjs.com renders
    something useful.

11. release-npm.yml's libkrunfw symlink step replaced the
    `( cd && ln && ln )` subshell with absolute-path `ln -sf`s.
    Subshell `set -e` propagation is bash-version-sensitive; the
    new form is unconditional.

84/84 → 85/85 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:43:08 +03:00

942 B

@wirenboard/agent-vm

Sandboxed VMs for AI coding agents — Claude Code, Codex CLI, OpenCode — running inside per-project libkrun microVMs built on microsandbox.

This package is a thin launcher; the actual native binaries (agent-vm, the patched msb, libkrunfw) ship in the platform-specific subpackage installed automatically as an optionalDependency (e.g. @wirenboard/agent-vm-linux-x64).

Install

npm install -g @wirenboard/agent-vm
# or
npx @wirenboard/agent-vm <subcommand>

Requirements: Linux with /dev/kvm (your user must be in the kvm group) and Node 18+. macOS and Windows aren't supported yet.

Quick start

agent-vm setup            # pull the latest image, verify it boots
cd ~/your-project
agent-vm claude           # or codex / opencode / shell

Full docs, subcommand reference, and source: https://github.com/wirenboard/agent-vm.