Skip to content

add snapshot patch routes#92

Open
breardon2011 wants to merge 3 commits intomainfrom
snapshot-patches
Open

add snapshot patch routes#92
breardon2011 wants to merge 3 commits intomainfrom
snapshot-patches

Conversation

@breardon2011
Copy link
Copy Markdown
Contributor

Snapshot patch API — adds POST/GET/DELETE /snapshots/:name/patches so you can attach patches to snapshots by name instead of having to know the
underlying checkpoint ID. Resolves snapshot → checkpoint internally, delegates to existing patch logic. No new tables or migrations.

Snapshot "my-env" → checkpoint cp-A
├── Sandbox sb-1 (based_on_checkpoint_id = cp-A, last_patch_sequence = 0)
│ └── Checkpoint cp-B (sb-1's frozen state)
│ └── Sandbox sb-3 (based_on_checkpoint_id = cp-B, last_patch_sequence = 0)
└── Sandbox sb-2 (based_on_checkpoint_id = cp-A, last_patch_sequence = 0)

You add a patch to snapshot "my-env" (which patches cp-A):

  • sb-1: gets the patch on next wake (based on cp-A)
  • sb-2: gets the patch on next wake (based on cp-A)
  • cp-B: does NOT get patched — it's a frozen artifact, not a running sandbox
  • sb-3: does NOT get the patch — it's based on cp-B, not cp-A

Patches are one level deep. They apply to sandboxes whose based_on_checkpoint_id matches the patched checkpoint. That's it. No cascading through
checkpoint chains.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensandbox Ready Ready Preview, Comment Mar 28, 2026 1:26am

Request Review

@breardon2011 breardon2011 marked this pull request as ready for review March 28, 2026 00:48
@breardon2011
Copy link
Copy Markdown
Contributor Author

Going to do a follow up PR on the way the SDK handles returning "creating" and "running" etc, so there is something more awaitable, and errors are surfaced from patching more cleanly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant