test: always-on hub test VM (clean PC for remote-hub testing)#257
Conversation
scripts/hub-test-vm.sh provisions a persistent clean Ubuntu VPS that plays a user's PC: published CLI from npm, gh logged in as the test account, and a credential vault outside ~/.agentbox so every run can start from virgin state. docs/hub-test-vm.md is the runbook + test matrix.
…rst live pass - pkill -f agentbox-relay matched the ssh command line running it, so reset killed its own session and stopped before the wipe; bracket the pattern. - Retry the control box's firewall delete (it stays attached to the dying server) and treat 404 as gone. - run/log subcommands: a long command needs tmux, an ssh nohup dies mid-pull.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c36830. Configure here.
|
|
||
| cmd_ssh() { | ||
| require_vm | ||
| if [[ "${1:-}" == "--" ]]; then shift; ssh_dev_tty "$@"; else ssh_dev_tty "$@"; fi |
There was a problem hiding this comment.
SSH subcommand always allocates TTY
Medium Severity
cmd_ssh always calls ssh_dev_tty (ssh -tt), including for hub-test-vm.sh ssh -- <cmd>. That gives the remote command a pseudo-TTY, so it does not match the doc’s “no TTY” path for auto-skipping the first-run wizard.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9c36830. Configure here.
| [[ $# -gt 0 ]] || die "usage: $0 run '<command>'" | ||
| local session="${AGENTBOX_TESTVM_SESSION:-work}" | ||
| local proj="${AGENTBOX_TESTVM_PROJECT:-agentbox-hubtest}" | ||
| ssh_dev "tmux kill-session -t $session 2>/dev/null; tmux new -d -s $session 'cd ~/projects/$proj && $*'" |
There was a problem hiding this comment.
Run command breaks on quotes
Medium Severity
cmd_run embeds the user command inside single quotes in the remote tmux new shell line. Any single quote in the command terminates that quoting early and yields a broken or truncated remote command.
Reviewed by Cursor Bugbot for commit 9c36830. Configure here.
| [[ -n "$sid" ]] && api DELETE "/servers/$sid" >/dev/null 2>&1 || true | ||
| [[ -n "$kid" ]] && api DELETE "/ssh_keys/$kid" >/dev/null 2>&1 || true | ||
| rm -rf "$STATE_DIR" | ||
| echo ">> done" |
There was a problem hiding this comment.
Down skips cloud box cleanup
Medium Severity
cmd_down deletes the test VM and local state after optionally tearing down the VM’s control box, but it never destroys AgentBox boxes on the VM first (unlike reset). Leftover docker/e2b/Hetzner resources can keep billing in the shared provider accounts.
Reviewed by Cursor Bugbot for commit 9c36830. Configure here.


Why
Testing the remote hub (control box) needs a machine that is not this laptop: virgin
~/.agentbox, the published CLI, a realghlogin that isn't mine. This adds that machine and its runbook.What
scripts/hub-test-vm.sh— provisions and drives a persistent clean Ubuntu VPS on Hetzner (cx33/nbg1, node 20 + docker + git + gh + tmux, non-rootdev). Subcommands:up · creds · install [nightly|latest|<ver>] · deploy · testrepo · reset · run · log · ssh · info · down./home/dev/testkit: provider keys, the test account's PAT, agent logins) lives outside~/.agentbox, soresetwipes AgentBox state completely and re-seeds credentials in a second.resetalso destroys the boxes the VM created and the control box it deployed — identified by the ids in the VM's owncontrol-plane/deploy.json, because theagentbox.role=control-planelabel is also worn by a control box deployed from the laptop.PROVIDER_SECRET_KEYSfromcontrol-plane-deploy.ts, never the wholesecrets.env.docs/hub-test-vm.md— setup, the per-runreset, and the test matrix (A docker baseline, B e2b, C hub deploy, D hub-routed create + host-off push), plus gotchas. Linked from the CLAUDE.md doc map.Verified live (nightly
0.28.0-nightly.202607260716, from virgin state)Docker box on a clean Linux host (GHCR pull, web service, in-box push, destroy) · e2b bake ·
hub setup --deploy hetzner(healthz 200, CLI repointed) · custody + project push · hub-routed e2b create · adopt ·agentbox-ctl git pushwith the VM's own relay stopped ·resetback to virgin. Findings are recorded in the doc (hub create needs a base bake on one side;hub boxes <action>takes the id, not the name;agentbox urlcan't open a browser on Linux).Docs-and-scripts only — no runtime code touched.
https://claude.ai/code/session_01Csib9o41p5RRUpmrPgPked
Note
Low Risk
Documentation and internal test automation only; no product runtime paths change. Operators should still treat
reset/downand shared cloud accounts carefully to avoid accidental resource deletion.Overview
Adds end-to-end remote-hub testing on a dedicated Hetzner Ubuntu VPS that simulates a clean user PC, without relying on laptop state.
scripts/hub-test-vm.shprovisions and drives that VM (up,creds,install/deploy,testrepo,reset,runvia tmux,ssh,log,info,down). A credential vault at/home/dev/testkitsurvivesreset’srm -rf ~/.agentbox, so each run starts from virgin AgentBox state while provider keys (filtered to matchPROVIDER_SECRET_KEYS), a separate test-account GitHub PAT, and agent login backups are re-seeded.resettears down boxes by name (explicitly notprune, which could orphan-delete laptop sandboxes), removes the control box recorded in the VM’s owndeploy.json, and optionally keeps the hub with--keep-hub.docs/hub-test-vm.mddocuments setup, the per-runresetworkflow, a test matrix (docker baseline, e2b, hub deploy, hub-routed create and relay-off push), first-pass results, and gotchas.CLAUDE.mdlinks the new doc in the documentation map.Docs and scripts only — no CLI, hub, or provider runtime changes.
Reviewed by Cursor Bugbot for commit 9c36830. Configure here.