From 0c87911cb19cc6e9391a33bf328e3491017b0b11 Mon Sep 17 00:00:00 2001 From: claude-hdb Date: Tue, 14 Jul 2026 15:28:25 +0000 Subject: [PATCH] fix: give the agent five minutes, and ship the console log when it never comes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run 14: the blank mint — the FIRST VM launch on the fresh btrfs pool, which unpacks the image into a pool volume and takes the coldest boot — died at wait_agent's 3-minute window ('Processes: -1' well past it), while the identical claude mint sixty seconds later booted in the warm path and passed in 96s. The window was tuned on a dir pool with a cached, unpacked image. 150×2s now, and on failure box new prints the VM's console log tail before dying — this run's evidence was torn down with the box before anyone could read it. --- bin/box | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/box b/bin/box index 6511657..67218c0 100755 --- a/bin/box +++ b/bin/box @@ -468,12 +468,22 @@ pick_mode() { fi } +# Five minutes, not three: the first VM launch on a fresh pool unpacks the +# image into a pool volume and takes the coldest possible boot — measured +# live, an agent can need past the 3-minute mark exactly once per pool while +# every later boot answers in seconds. And when it still fails, ship the +# forensics: the VM's console says why, and the box is torn down by whoever +# called us before anyone can read it. wait_agent() { local n="$1" i echo "box: waiting for instance agent..." - for i in $(seq 1 90); do + for i in $(seq 1 150); do if incus exec "$n" -- true /dev/null 2>&1; then return; fi - [ "$i" -eq 90 ] && die "instance agent never came up (incus console $n to inspect)" + if [ "$i" -eq 150 ]; then + echo "box: instance agent never came up. The VM's console log:" >&2 + timeout -k 5 15 incus console "$n" --show-log 2>/dev/null | tail -15 | sed 's/^/ /' >&2 + die "agent unreachable after 5 minutes (incus console $n to inspect live)" + fi sleep 2 done }