Compare two candidate fixes
This complete SDK 0.5.1 program uses two candidate values and a deterministic check. Complete the Python quickstart setup first. It selectsContreeSession, which saves after each non-disposable command, so each candidate runs on fresh compute.
create_branch() creates a branch without selecting it. switch_branch() selects its saved state. The default commit policy retains API-successful results even when their process exits nonzero; the right branch is saved but rejected by the application check. No API merges two images.
With the default lazy session, call snapshot() before branching or switching. A snapshot saves files and stops the VM. Use SDK branching for explicit snapshots, rollback, and navigation through history.
Recovery boundary
Record the known-good image UUID before speculative work. After a nonzero exit, platform failure, cancellation, timeout, or disconnect, keep operation IDs and safe diagnostics. Query uncertain operation outcomes before resubmitting. A failed or cancelled SDK wait attempts remote cancellation; it does not establish that the cancellation succeeded.rollback() moves the selected history position; it does not undo external side effects. A saved image must still be available on the service. For history across Python processes, supply a persistent store and stable session ID. Tags are mutable pointers, so record UUIDs for reproducibility.
See Recover from a known-good image and Troubleshooting.