mirror of
https://github.com/wirenboard/agent-vm.git
synced 2026-07-09 16:00:54 +00:00
agent-vm mirrors the host cwd into the guest at the same absolute path, but a Cyrillic-named directory crashed the VMM at boot: libkrun packs the guest workdir + env into a printable-ASCII-only kernel command line and .unwrap()s a non-ASCII byte into a SIGABRT. Three changes make the real path work instead of falling back to /workspace: 1. Mount specs travel off the cmdline. The bumped submodule moves MSB_DIR_MOUNTS/FILE/DISK to a boot-params file on the runtime virtiofs share (agentd reads it at init). run.rs hands libkrun a '/' workdir placeholder when the real path isn't cmdline-safe and pins the agent's real cwd via the byte-safe vsock exec request (attach_with/.cwd on both the TTY and streaming paths). A mandatory post-boot fs().exists(real) probe fails loud if the bind didn't materialize (chdir failure is otherwise silent). resolve_project_guest_path now mirrors the real path for non-ASCII/whitespace; only a tmpfs-overlap or a control-char path (unframable for boot-params) still falls back to /workspace. 2. UTF-8 locale. The base image ships with no locale (C/POSIX), which renders a Cyrillic cwd as `M-P…` meta-escapes in bash/readline AND makes filesystem encodings default to ASCII so Python/Node/ripgrep mis-handle the path even when it mounted. Pin LANG=C.UTF-8 for every guest (GUEST_ALWAYS_ENV in run.rs) and in images/Dockerfile. 3. Ship producer and consumer in lockstep. agentd is embedded in msb and was downloaded as a release prebuilt; the new producer needs the new consumer, so release-npm.yml's build-msb now builds agentd from the pinned source (musl) and links msb with --no-default-features (drops the `prebuilt` download). A stale prebuilt would have dropped every mount for every user. Verified: bash/readline renders the real Cyrillic path as glyphs under C.UTF-8 (pty capture) and as the reported M-P escapes without it; the boot-params channel carries the path byte-intact and a normal launch mounts correctly. Full nested-guest agent runs hit this dev box's overlay-on-virtiofs limit (the probe reports it); validated on a real host via the path mirror. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||