feat(sandbox): release our code and the agent CLIs to boxes every night

Merged
SA
1mo ago
+76-15

Summary

  • bun run release now builds this checkout's CLI next to host-service and takes the latest claude (stable channel), codex (latest release) and Chrome (stable). If an upstream fetch fails, the release keeps the committed pin and logs a warning.
  • The Sandbox workflow runs production-release every night at 09:00 UTC. Merges that touch packages/sandbox/** still release right away.
  • The probe launches each cloud agent preset's base command (claude --dangerously-skip-permissions, codex --dangerously-bypass-approvals-and-sandbox --dangerously-bypass-hook-trust) with stdin closed. It fails on an unknown-flag error or a missing binary, so an upstream flag rename blocks the release and doesn't reach boxes.
  • A failed nightly run opens an issue, or comments on the open one. Boxes keep the previous release, because the rows are only written after the probe passes.
  • The cli producer compiles the i18n catalogs first. They are gitignored, so build:linux-x64 failed on a clean checkout, CI included.

Why

Boxes ran CLI 1.35.0 while main shipped 1.38.0, so workspaces archive (#8267) never reached them. claude was 2.1.280 against stable 2.1.292, and Chrome is two majors behind. Each third-party pin only moved when someone ran bun run assets with CDN credentials. host-service was already rebuilt at release time, but a release only ran on a merge to packages/sandbox/**, so a host-service-only change waited for an unrelated merge.

Now our code and the agent CLIs take one path to boxes: the release. The release's golden and probe (a real box, including stop and wake) are the gate, so this needs no bot PRs, no review bypass and no repo auto-merge setting.

Supersedes #8525.

Trade-offs

  • The committed rows for host-service, cli, claude, codex and Chrome are now the minimum versions, used only by the PR boot test. To see what boxes run, read the release log, which prints a pins: line.
  • Each nightly release can publish a new host-service asset, so boxes may re-download it on their next wake. That's fine while we're in internal testing.
  • Not followed yet: go (image), the ACP adapters (host-service code dependencies, so they stay on Dependabot), fonts and themes.

Testing

  • bun run typecheck and bun test in packages/sandbox pass.
  • With the compiled catalogs deleted, bun run assets cli now builds. It produced the same sha as a build with the catalogs present, so the CLI build is reproducible.
  • bun run assets claude resolves 2.1.292 and bun run assets codex resolves 0.162.1, both checksum-verified. chrome needs Docker, which the cloud workspace I worked in doesn't have; the release runner has it.
  • I ran the preset check locally against claude 2.1.280 and codex 0.162.1. Both pass. A misspelled codex flag and a missing binary both fail.
  • The full release was not run. After merging, dispatch production-release once and check the pins: line, then run superset --version in a new cloud workspace.

Summary by cubic

Nightly releases now carry our CLI and the latest claude, codex and Chrome to boxes, so boxes stop running versions far behind main and upstream.

Boxes ran the CLI at 1.35.0 while main shipped 1.38.0, and third-party pins only moved when someone ran bun run assets with CDN credentials. bun run release now builds this checkout's CLI, takes the latest claude (stable), codex and Chrome, and keeps the committed pin with a warning when an upstream fetch fails. The production-release workflow runs every night at 09:00 UTC in addition to the existing merge-triggered releases.

  • The probe launches each cloud agent preset's base command with stdin closed and fails on an unknown-flag error, a missing binary, or a nonzero exit, and runs superset --version, so an upstream flag rename or a CLI that compiles but cannot start stops the release and never reaches a box.
  • A failed nightly run opens an issue or comments on the open one; boxes keep the previous release since rows are written only after the probe passes.
  • The CLI producer compiles the gitignored i18n catalogs first, so build:linux-x64 no longer fails on a clean checkout.
  • The committed rows for host-service, cli, claude, codex and Chrome are now the floor used only by the PR boot test; the release log's pins: line shows what boxes actually run.

Summary by CodeRabbit

  • New Features
    • Production sandbox releases now run daily at 09:00 UTC, on main-branch pushes, and through matching manual dispatches.
    • Releases build the CLI from the current checkout and update Claude, Codex, and Chrome assets to their latest available versions. If an upstream version can’t be resolved, the existing pinned version is retained.
    • Sandbox checks validate cloud-agent preset commands and confirm the reported version format.
    • When a scheduled release fails, the workflow comments on an open tracking issue or creates one if needed.
  • Documentation
    • Updated versioning notes clarify which asset versions update during a release.