Start repository sandboxes from checkout before optional Relayfile context

Merged
KH
2d ago
+529-38

fleet spawn --sandbox inside a repository currently materializes a live Relayfile tree and waits for its mount before dispatch. Start repository tasks from Cloud's existing depth-1 Git checkout at the exact clean, pushed HEAD, with Relayfile disabled by default. --checkout follows the same policy, and nested caller directories map into the verified remote checkout.

--sandbox-relayfile preserves required live context before startup; explicit subtree selections remain required as well. Add fleet relayfile attach to mount optional context later in an existing sandbox using Cloud sign-in. It sends validated exact roots such as /linear, never a checkout destination, and polls only confirmed 202 pending responses for that same sandbox. One deadline covers session lookup, cancellable token refresh/lock waits and subsequent POSTs. Failed attachments are not retried and do not allocate a replacement or redispatch the worker.

This changes the repository default; the changelog and CLI guide explain migration to --sandbox-relayfile. Outside Git, the workspace mount default is retained. Clean/pushed revision and retained-checkout guards remain in force. Checkout-only mode is explicitly documented as having no live mirror or workspace skills.

Validation at f9f32a5f3:

  • node node_modules/vitest/vitest.mjs run packages/cloud/src/fleet-sandbox.test.ts packages/cloud/src/auth.test.ts packages/cli/src/cli/commands/fleet-sandbox-regression.test.ts packages/cli/src/cli/commands/fleet.test.ts packages/cli/src/cli/commands/fleet-lifecycle-integration.test.ts packages/cli/src/cli/lib/sandbox-repo.test.ts — 323 passed. Existing auth fixtures require local loopback access.
  • Seven attachment assertions fail when the latest client fixes are reverted: exact-root body contract, stalled-auth deadline, same-sandbox pending polling and four invalid-root cases. Earlier checkout dispatch and response identity revert controls remain covered.
  • npm run typecheck — exit 0.
  • npm --prefix packages/cli run lint -- --quiet — exit 0.
  • git diff --check origin/trunk..HEAD and Veto host-assisted full code/security/secrets review — pass.

Cloud PR #4835 defers Agent37 tooling and provides resumable optional attachment with verified receipts and candidate bindings. Merge Cloud first, then Relay; deploy Cloud before releasing the CLI. A live latency canary remains outstanding.

Agent Relay sessions


Agent Relay sessions

  • codex session 01a1307f · opened via gh pr create · last active 2026-10-12