Conversation
✱ Stainless preview buildsThis PR will update the ✅ hypeman-go studio · code
|
|
depends on #123 |
There was a problem hiding this comment.
Stale comment
Automated risk assessment for this PR:
- Risk level: Medium-High
- Code review required: Yes
- Approval status from automation: Not approved
Evidence from diff (code-based only):
- Introduces a new snapshot lifecycle in core runtime paths (
lib/instances/snapshot.go,lib/instances/manager.go,lib/instances/types.go) including create/list/get/delete/restore/fork behavior.- Changes fork/copy semantics to sparse extent copying with platform-specific behavior (
lib/forkvm/copy.go,lib/forkvm/copy_sparse_unix.go,lib/forkvm/copy_sparse_unsupported.go), which affects VM data cloning and restore paths.- Expands external API surface with multiple new snapshot endpoints and schema updates (
openapi.yaml, regeneratedlib/oapi/oapi.go).Given the blast radius across instance state transitions, disk snapshot handling, and API contracts, this should be reviewed by domain maintainers before merge.
Requested reviewers:
@rgarcia,@hiroTamada.
There was a problem hiding this comment.
Automated risk assessment for this PR:
- Risk level: High
- Code review required: Yes
- Approval status from automation: Not approved
Evidence from the actual diff:
- Adds a new snapshot lifecycle in core instance-management codepaths, including create/list/get/delete/restore/fork flows with state-transition logic and filesystem replacement/copy operations (
lib/instances/snapshot.go,lib/instances/manager.go,lib/instances/types.go,lib/instances/errors.go). - Modifies fork behavior in lifecycle transitions by introducing additional guest-agent readiness gates when returning running instances (
lib/instances/fork.go). - Introduces new API handlers and OpenAPI surface for snapshot management and snapshot-based restore/fork operations (
cmd/api/api/snapshots.go,openapi.yaml, regeneratedlib/oapi/oapi.go). - Adds a new snapshot persistence subsystem and storage layout (
lib/snapshot/store.go,lib/snapshot/types.go,lib/snapshot/record.go,lib/paths/paths.go).
This is a large cross-cutting behavioral change (24 files, ~4.5k insertions) across VM lifecycle, storage semantics, and external API contracts, with high regression and operational risk.
Reviewer assignment:
- Review is required.
- Two reviewers are already assigned (
@rgarcia,@hiroTamada), so no additional reviewer requests were made.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


Note
High Risk
Adds new snapshot lifecycle operations that copy/replace VM guest directories and interact with hypervisor standby/restore flows, so bugs could lead to data loss or broken instance state transitions. Also expands the public API surface and manager interface, requiring careful validation across hypervisors.
Overview
Adds a centrally managed snapshot feature for instances, including storage under
data/snapshots/with metadata + guest payload, and new manager methods (CreateSnapshot,RestoreSnapshot,ForkSnapshot,List/Get/DeleteSnapshot) plusErrSnapshotNotFound.Exposes snapshots via new HTTP endpoints (
POST /instances/{id}/snapshots,POST /instances/{id}/snapshots/{snapshotId}/restore,GET/DELETE /snapshots,GET /snapshots/{snapshotId},POST /snapshots/{snapshotId}/fork) with updated generatedoapiclient/server types and response parsing.Implements snapshot semantics for
StandbyvsStoppedkinds (including target-state defaults, hypervisor override only for stopped snapshots, sparse-copy enforcement, name uniqueness, and read-only volume safety), updates fork target-state transitions to re-check guest-agent readiness for running returns, and adds integration/unit coverage across Firecracker/QEMU/Cloud Hypervisor/VZ.Written by Cursor Bugbot for commit 34aa764. This will update automatically on new commits. Configure here.