Skip to content

fix(controller,host,core): remaining hints name --host; elapsed times use a monotonic clock - #247

Merged
benvinegar merged 3 commits into
masterfrom
fix/leftover-hints-timing
Nov 9, 2026
Merged

benvinegar merged 3 commits into
masterfrom
fix/leftover-hints-timing

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Follow-up to #217 and #215, found while checking the merged fixes live on Lima, libvirt and exe.dev.

Hints that still dropped --host

  • new / fork's outdated-guest warnings (fix(host): new --headless reboots once if first boot asks; new warns when made from an outdated guest (#215) #236) said boxery patch NAME and boxery build-base. They use the host's hint() now, so boxery --host lab new … suggests boxery --host lab patch NAME.
  • Messages shared by the CLI and the agent tools now use a new core cliHint(): no such vm, a stopped VM, pool leases, the desktop errors, vm_info's outdated note, and no local lease. It names --host NAME when the person gave one (BOXERY_CLI), or when the VM's host isn't the default (another host's VM in cp, an agent's host session), since a bare boxery start NAME goes to the default host. A malformed default-host file doesn't replace the message.
  • jobs: both hints use the invoked form. A missing job id is a usage error (exit 2, like a missing VM name). An invalid one still exits 1.
  • setup's pin note and capabilities' backends hint use hint().

Timing flake
secs() in new, fork and patch, and stop's wait loop, used Date.now(). A CI runner's clock stepping back a few ms printed installed -1s after create and failed host-output.sh "new --headless logs the layers it installs" on three PRs today. They use performance.now() now, which is monotonic. Wall-clock uses that compare against file times or expiries are unchanged.

Tests

  • controller-local.sh: --host local run nosuch names --host.
  • hosts.test.mjs: a non-default host via MCP names --host, also with a malformed default-host. Checked that this test fails without the guard.
  • host-patch.sh: boxery-host called directly says boxery-host patch …; with BOXERY_CLI="boxery --host lab" it says boxery --host lab patch ….
  • cli-families.test.mjs: missing job id exits 2, invalid exits 1.

Checks: lint, typecheck, npm test (473), npm run test:shell, docs:cli (no diff), help-drift and backend-capabilities. Two load-sensitive tests failed once at a load average around 50: the cloud-hypervisor stop race and a copy timing test. Neither is touched here, and both passed when rerun alone.

Review: an independent reviewer subagent read the diff and found no correctness issues. Applied: the defaultHost() guard, plus cliHint in vm_info's outdated note and no local lease. Not changed: the upgrade hints in formatVersions, versions.mjs and profile.mjs. They take an explicit host that may not be the current one, and they already name --host for a non-default host.

This PR description was generated by Claude Code using Claude Opus 5.5

benvinegar and others added 3 commits November 8, 2026 20:16
Hints the earlier fixes missed:
- new/fork's outdated-guest warnings (#236) use the host's hint(), so
  `boxery --host lab new …` suggests `boxery --host lab patch NAME`.
- Core messages for a VM that can't be reached (no such vm, stopped,
  pool lease) and the desktop errors use a new core cliHint(): --host NAME
  when the person gave one or the VM's host isn't the default, since a bare
  `boxery start NAME` goes to the default host. Shared with the agent tools.
- jobs: hints use the invoked form; a missing job id is a usage error (2).
- setup's pin note and capabilities' backends hint use hint().

secs() in new, fork and patch, and stop's wait, used Date.now(). A CI
runner's clock stepping back a few ms printed "installed -1s after
create" and failed host-output.sh intermittently; performance.now() is
monotonic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d plain formatting)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@benvinegar
benvinegar merged commit a983e96 into master Nov 9, 2026
10 checks passed
@benvinegar
benvinegar deleted the fix/leftover-hints-timing branch November 9, 2026 01:30
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