Conversation
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ hypeman-openapi studio · code · diff
✅ hypeman-go studio · code · diff
✅ hypeman-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
…sion-delay # Conflicts: # cmd/api/api/instances_test.go # lib/instances/create.go # lib/instances/types.go # lib/oapi/oapi.go
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.
Reviewed by Cursor Bugbot for commit 080050b. Configure here.
|
waiting until data or use case justified |

Summary
POST /instances/{id}/standbyand a per-instance default insnapshot_policyTesting
go test ./lib/instancesgo test ./cmd/api/api -run 'Test(CreateInstance_MapsStandbyCompressionDelayInSnapshotPolicy|CreateInstance_InvalidStandbyCompressionDelayInSnapshotPolicy|InstanceToOAPI_EmitsStandbyCompressionDelayInSnapshotPolicy|StandbyInstance_MapsCompressionDelay|StandbyInstance_InvalidCompressionDelay|StandbyInstance_InvalidRequest)$'Notes
go test ./cmd/api/apistill hits unrelated environment-dependent volume tests on this machine becausemkfs.ext4is not available in$PATH.Note
Medium Risk
Changes standby snapshot compression scheduling and cancellation semantics (including restart recovery) and updates networking iptables rule management to wait on the xtables lock; these touch core instance lifecycle and host networking paths but are gated behind new optional fields and covered by tests.
Overview
Adds a standby-only snapshot compression delay that can be set per request via
POST /instances/{id}/standby(compression_delay) and as a per-instance default viasnapshot_policy.standby_compression_delay(OpenAPI + API/domain mappings + validation).Implements delayed compression jobs in the instance manager: jobs can be pending-delay vs running, can be skipped if canceled before start, persist a
PendingStandbyCompressionplan in instance metadata for restart recovery, and clear that plan on restore/snapshot operations; preemption metrics are now recorded only when interrupting active compression.Extends observability with new snapshot compression metrics (wait duration, active vs pending gauges, skipped result), additional logs/traces, and includes targeted unit/integration test hardening (guest exec retries/readiness probe) plus more reliable iptables operations/tests using
iptables -w 5to avoid xtables lock flakes.Reviewed by Cursor Bugbot for commit 17cb581. Bugbot is set up for automated code reviews on this repo. Configure here.