Skip to content

Let an agent's image build install from a host folder - #976

Merged
lavaman131 merged 1 commit into
mainfrom
nvx-install-from
Nov 21, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
nvx-install-from

Conversation

@lavaman131

@lavaman131 lavaman131 commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Follows #975 (merged; this is rebased on main). An agent's image build runs install scripts in a microVM with no credentials, so it can't install a package a registry serves only to a signed-in person. This adds chopin connect --install-from <dir>: a folder the owner fills on the host (for example with npm pack under their own sign-in), which each image build reads read-only at /install-from.

What changes

  • --install-from <dir> is saved by its absolute path with the other connect settings and given to the service. It is refused before anything is paired when the folder is missing, or when there is no --install or --planner-install command to read it.
  • Each image made from --install or --planner-install commands is built with a copy of the folder, shared read-only at /install-from with the build's microVM. No agent's microVM gets it, and the image's start check gets no share either.
  • The copy holds files and folders only. A link is refused rather than followed to what it names on the host. The copy is readable by the build's own user (nobody in the release's layer) whatever the folder's own modes, so a private folder such as ~/.something (0700) works.
  • The image key now includes the folder's contents: each file's path, content and executable bit. A changed file builds the image again, and moving the folder doesn't. The build checks that the copy is what the key was made of. A recipe without a folder keeps the key it had, so existing images aren't rebuilt.
  • Docs: docs/chopin-cli.md (Coding agents, the sandbox options table, Commands) and docs/nvx-sandbox.md (Images). The Coding agents section now also says where npm install -g puts a package in the image (/opt/chopin/agent/lib/node_modules/<name>), so an agent command can name its package root.

Tests

  • images.test.ts: the key changes when a file changes, is added, moves or becomes executable. The copy is exactly what was digested and is 0644/0755 from a 0700 source. A link is refused.
  • main.test.ts: the folder is saved by its full path, and is refused when missing or when no command reads it, before anything is sent to Chopin.
  • nvx-vm.test.ts (real KVM): an image whose install copies a program from a 0700 host folder runs that program in its guest, and an agent's guest has no /install-from. All 9 real-VM tests pass locally on KVM with NVX v0.1.0-dev.c753e7b4c288 (57 s, including both image builds).
  • bun test in apps/connector: 415 pass, 26 skip (the VM tests, without /dev/kvm in that shell). bun run types and bun run ci pass.

Base automatically changed from nvx-sandbox to main November 21, 2026 12:04
An image's build runs install scripts in a microVM with no credentials,
so it can't install anything a registry serves only to a signed-in
person. `chopin connect --install-from <dir>` names a folder the owner
filled on the host, such as packages fetched with `npm pack` under
their own sign-in. Each build of an image made from `--install` or
`--planner-install` gets a copy of it, read-only at `/install-from`;
no agent's microVM gets it. The copy is readable by the build's own
user whatever the folder's modes, holds files and folders only (a link
is refused rather than followed), and must match what was read for the
image's key, which now includes each file's path, content and
executable bit. A changed file builds the image again; moving the
folder doesn't. The folder is saved by its absolute path for the
service, and is refused when it is missing or no install command could
read it.

Co-authored-by: Alex Lavaee <lavaman131@github.com>
@lavaman131
lavaman131 merged commit fca5f0b into main Nov 21, 2026
26 checks passed
@lavaman131
lavaman131 deleted the nvx-install-from branch November 21, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant