Skip to main content
Branching means starting independent operations from one immutable image UUID. Each branch receives new compute and its own filesystem changes.

Compare two candidate fixes

  1. Verify a baseline operation and record its result image UUID.
  2. Resolve that UUID with images.use(..., strict=True).
  3. Start alternatives from the same object; set disposable=False when the changed files must be inspected or selected.
  4. Compare command exit codes and deterministic artifacts. An accepted or terminal API operation alone does not establish test success.
  5. Resolve the passing branch’s result UUID and start a new continuation operation from it.
The fragment below shows the selection logic. It runs inside an async function with asyncio imported, an authenticated client, and a verified baseline image. apply-left, apply-right, and run-tests stand for commands supplied by the application; Sandboxes does not provide commands with those names. Use Try two coding fixes and keep the passing branch for a complete runnable example.
No API merges two images. A chosen branch does not continue a process from its test run.

Recovery boundary

After a nonzero exit, platform failure, cancellation, timeout, or disconnect, keep the operation ID and safe diagnostics. Query the operation before resubmitting. Choose the next image using the result-image rules. Tags are mutable pointers. Use them for discovery and record UUIDs for reproducibility. See Recover from a known-good image and Troubleshooting.