feat(vercel-sandbox,sandbox): introduce keepLast parameters for SDK/CLI (under feature flag)#164
Draft
marc-vercel wants to merge 2 commits intonamed-sandboxesfrom
Draft
feat(vercel-sandbox,sandbox): introduce keepLast parameters for SDK/CLI (under feature flag)#164marc-vercel wants to merge 2 commits intonamed-sandboxesfrom
marc-vercel wants to merge 2 commits intonamed-sandboxesfrom
Conversation
…LI (under feature flag)
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
QuiiBz
approved these changes
Apr 27, 2026
| * on this sandbox, if any. | ||
| */ | ||
| public get keepLastSnapshots(): | ||
| | { count: number; expiration?: number; deleteEvicted: boolean } |
Member
There was a problem hiding this comment.
We could use SandboxMetaData['keepLastSnapshots'] here and everywhere else where we duplicate the types definition, but I think we should instead extract into its own type (basically everything line 119-134) so we keep the TSDoc everywhere
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce
keepLastsnapshot retention andforceDeletefor the SDK and CLI. These changes are gated behind a feature flag until we agree that this is the correct contract.CLI
sandbox createand the newsandbox config keep-lastsubcommand configure a retention policy that keeps only the N most recent snapshots. By default, evicted snapshots are deleted immediately; pass--soft-evictto let them fall back to the sandbox's default expiration instead.sandbox snapshots deletesupports--force/-fto delete a snapshot that is currently the sandbox'scurrentSnapshotId(server rejects the delete without it when the flag is on):SDK
Sandbox.createandSandbox.updateaccept a new optionalsnapshotKeepLastfield.On
Sandbox.update, passnullto remove the policy:snapshot.deleteacceptsforceDeleteto bypass the server's in-use check where we fail if the latest snapshot is being used by a sandbox (and is the last snapshot):