Skip to content

[cli] accept sizes with units on drives --max-size - #342

Merged
erulkey merged 5 commits into
mainfrom
feat/drives-size-prompt
Oct 19, 2026
Merged

erulkey merged 5 commits into
mainfrom
feat/drives-size-prompt

Conversation

@erulkey

@erulkey erulkey commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

sandbox drives get-or-create --max-size 2TiB currently parses the size as 2 bytes and returns an unrelated minimum-size error. Accept sizes with units (200GiB, 2TiB) alongside raw bytes, and reject malformed input before calling the API.

Units are case-insensitive. GB and TB use the same binary multipliers as GiB and TiB, matching how drive sizes are documented. When --max-size is omitted, the output adds (set with --max-size at creation, fixed afterwards). This also applies when retrieving an existing drive, without implying that its size is the plan default.

Includes the Sandbox skill examples and generated CLI reference. The size hint applies only to get-or-create; drive forks retain their existing summary.

Validation against current main:

  • All 228 CLI tests pass, including size parsing, invalid input, the conditional hint, and drive-fork coverage.
  • CLI production build and SDK/CLI type checks pass.
  • Seven live cases passed against a test project: 200GiB, 2TiB, raw bytes, the GB alias, malformed input, retrieving an existing drive without a size, and creating a drive with the default size. The three test drives were deleted after verification.

The changeset releases this in the next minor CLI version; merging alone does not publish the package.

@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
sandbox Ready Ready Preview, v0 Oct 19, 2026 2:08am UTC
sandbox-cli Ready Ready Preview Oct 19, 2026 2:08am UTC
sandbox-sdk-ai-example Ready Ready Preview Oct 19, 2026 2:08am UTC
workflow-code-runner Ready Ready Preview Oct 19, 2026 2:08am UTC

Request Review

@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

You must have Developer access to commit code to Vercel Labs on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles

Comment thread packages/sandbox/src/commands/drives.ts Outdated
Comment thread packages/sandbox/src/util/prompt.ts Outdated
Base automatically changed from fix/cli-binary-size-units to main September 21, 2026 19:50
@erulkey erulkey changed the title [cli] ask for the drive size limit interactively and accept sizes with units [cli] accept sizes with units on drives --max-size Sep 22, 2026
@erulkey
erulkey requested a review from marc-vercel September 22, 2026 20:56
@erulkey
erulkey force-pushed the feat/drives-size-prompt branch from 48bef9e to 62d229c Compare September 22, 2026 20:57
@erulkey
erulkey merged commit e6940f9 into main Oct 19, 2026
13 checks passed
@erulkey
erulkey deleted the feat/drives-size-prompt branch October 19, 2026 02:12
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
marc-vercel pushed a commit that referenced this pull request Oct 19, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## sandbox@4.9.0

### Minor Changes

- Add `sandbox extend` to increase a running session's timeout without
changing future session defaults, and clarify `sandbox config timeout`
help. ([#389](#389))

- `sandbox drives get-or-create --max-size` now accepts sizes with units
(`200GiB`, `2TiB`) as well as raw bytes, and rejects input it cannot
parse instead of truncating it, so `2TiB` is no longer read as 2 bytes.
When `--max-size` is omitted, the printed size says where it came from:
`max size: 1 TiB (set with --max-size at creation, fixed afterwards)`.
([#342](#342))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

4 active deployments
Preview – sandbox-sdk-ai-example — ab7ac53c Deployed Oct 19, 2026 by vercel[bot]
Preview – sandbox — ab7ac53c Deployed Oct 19, 2026 by vercel[bot]
Preview – workflow-code-runner — ab7ac53c Deployed Oct 19, 2026 by vercel[bot]
Preview – sandbox-cli — ab7ac53c Deployed Oct 19, 2026 by vercel[bot]
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.

2 participants